]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 12365
authorAlan Modra <amodra@gmail.com>
Sun, 29 May 2011 04:51:51 +0000 (04:51 +0000)
committerAlan Modra <amodra@gmail.com>
Sun, 29 May 2011 04:51:51 +0000 (04:51 +0000)
PR 12613
PR 12632
PR 12739
PR 12753
PR 12760
PR 12763
Apply fix from mainline along with assorted other small fixes.

64 files changed:
bfd/ChangeLog
bfd/aoutx.h
bfd/archive.c
bfd/bfd-in2.h
bfd/bfdio.c
bfd/coff-aux.c
bfd/coffcode.h
bfd/coffgen.c
bfd/cofflink.c
bfd/config.in
bfd/configure
bfd/configure.in
bfd/dwarf2.c
bfd/elf-bfd.h
bfd/elf-m10300.c
bfd/elf.c
bfd/elf32-ppc.c
bfd/elf32-rx.c
bfd/elf64-ppc.c
bfd/elflink.c
bfd/elfxx-ia64.c
bfd/hosts/x86-64linux.h
bfd/libbfd.c
bfd/linker.c
bfd/peXXigen.c
bfd/vms-alpha.c
binutils/ChangeLog
binutils/doc/binutils.texi
binutils/nm.c
binutils/objcopy.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/nm.exp
binutils/testsuite/lib/utils-lib.exp
gas/ChangeLog
gas/config/obj-elf.h
gas/config/tc-arc.c
gas/config/tc-d10v.h
gas/config/tc-d30v.h
gas/config/tc-m32r.h
gas/dwarf2dbg.c
gas/input-scrub.c
gas/messages.c
gas/read.c
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/inval-equ-2.l
gas/testsuite/gas/symver/symver2.l
include/ChangeLog
include/ansidecl.h
include/bfdlink.h
ld/ChangeLog
ld/emultempl/elf32.em
ld/emultempl/pe.em
ld/emultempl/pep.em
ld/ldexp.c
ld/ldlang.c
ld/ldlex.l
ld/ldmain.c
ld/plugin.c
ld/scripttempl/pe.sc
ld/scripttempl/pep.sc
ld/testsuite/ChangeLog
ld/testsuite/ld-cris/tls-e-tpoffcomm1.d
ld/testsuite/ld-plugin/plugin-7.d
ld/testsuite/ld-plugin/plugin-8.d

index bcc02f3bf13593c0df5ecd5adb1a18574f0c17b6..2cb0a7fa61befcf8a246be8f2fc9d4710c867e23 100644 (file)
@@ -1,3 +1,112 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-05-26  Alan Modra  <amodra@gmail.com>
+       * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Remove most of comment.
+       * elflink.c (_bfd_elf_symbol_refs_local_p): Expand
+       local_protected comment.
+
+       2011-05-23  Alan Modra  <amodra@gmail.com>
+       PR 12763
+       * elf.c (assign_file_positions_for_load_sections): Set sh_offset for
+       .tbss, and page align same for all SHT_NOBITS sections.
+
+       2011-05-23  Nick Clifton  <nickc@redhat.com>
+       * elf-m10300.c (mn10300_elf_mkobject): New function.
+       (bfd_elf32_mkobject): Define.
+
+       2011-05-21  Alan Modra  <amodra@gmail.com>
+       PR 12763
+       * elf.c (_bfd_elf_make_section_from_shdr): Set up TLS section LMAs
+       from PT_TLS header.
+       (_bfd_elf_map_sections_to_segments): Don't create a final PT_LOAD
+       segment if just for .tbss.
+       (assign_file_positions_for_load_sections): Don't report "can't
+       allocate in segment" errors for .tbss.
+       (assign_file_positions_for_non_load_sections): Don't set p_filesz
+       from SHT_NOBITS section filepos.
+
+       2011-05-17  Alan Modra  <amodra@gmail.com>
+       PR ld/12760
+       * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Adjust "notice" call.
+       * elflink.c (elf_link_add_object_symbols): Likewise.
+       * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
+
+       2011-05-16  Alan Modra  <amodra@gmail.com>
+       * linker.c (_bfd_generic_link_add_one_symbol): Don't init u.undef.weak.
+
+       2011-05-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * config.in: Regenerated.
+       * configure: Regenerated.
+       * configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
+       HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
+       HAVE_PSINFO32_T_PR_PID.
+       * elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
+       HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
+       and HAVE_PSINFO32_T_PR_PID.
+       * hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
+
+       2011-05-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and
+       32bit psinfo.
+       * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid.
+       * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise.
+
+       2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
+       PR ld/12365
+       * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
+       references to symbols defined in discarded sections.
+
+       2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
+       PR ld/12365
+       * coffgen.c (coff_write_symbol): Assume input section is its own
+       output section if output_section member not set.
+       (coff_write_alien_symbol): Likewise.
+
+       2011-05-07  Anders Kaseorg  <andersk@ksplice.com>
+       PR 12739
+       * libbfd.c (bfd_get_8, bfd_get_signed_8): Use const cast.
+       * bfd-in2.h: Regenerate.
+
+       2011-04-28  Tom Tromey  <tromey@redhat.com>
+       * bfdio.c (memory_bstat): Pass correct size to memset.
+
+       2011-04-20  Alan Modra  <amodra@gmail.com>
+       * libbfd.c (bfd_log2): Do return rounded up value.
+       * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Replace bfd_log2
+       call with expanded old round down version of the function.
+       * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd.
+       * elflink.c (elf_link_add_object_symbols): Delete redundant code.
+
+       2011-04-09  Kai Tietz  <ktietz@redhat.com>
+       * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary
+       buffer and use rawsize for sorting.
+       * coffcode.h (coff_compute_section_file_positions): Set rawsize
+       before doing alignment.
+
+       2011-04-07  Cary Coutant  <ccoutant@google.com>
+       * dwarf2.c (scan_unit_for_symbols): Check for DW_AT_specification.
+
+       2011-03-03  Michael Snyder  <msnyder@vmware.com>
+       * aoutx.h (aout_final_link): Use sizeof int not sizeof int*.
+       (aout_link_write_other_symbol): Missing break statement.
+
+       2011-02-14  Mike Frysinger  <vapier@gentoo.org>
+       * elflink.c (bfd_elf_size_dynamic_sections): Add
+       bfd_get_symbol_leading_char to the start of newname.
+
+       2011-01-18  Pierre Muller  <muller@ics.u-strasbg.fr>
+       Fix compilation for mingw64.
+       * coffcode.h (coff_slurp_symbol_table): Add intptr_t intermediate
+       typecast to avoid warning.
+       * elf32-rx.c: Add "bfd_stdint.h" include required for int32_t type
+       usage.
+       * elfxx-ia64.c (elfNN_ia64_relax_br): Use intptr_t typeacast instead
+       of long for pointer to avoid warning.
+       (elfNN_ia64_relax_brl): Idem.
+       (elfNN_ia64_install_value): Idem.
+       * vms-alpha.c (_bfd_vms_slurp_etir): Idem.
+
 2012-05-25  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline
index 7ca221ecd6d878dbd04b15c3db36807e752edf2f..ec0bdf0326ab13830be86626d80e973fe62084f7 100644 (file)
@@ -3637,6 +3637,7 @@ aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
     case bfd_link_hash_undefweak:
       type = N_WEAKU;
       val = 0;
+      break;
     case bfd_link_hash_indirect:
       /* We ignore these symbols, since the indirected symbol is
         already in the hash table.  */
@@ -5448,7 +5449,7 @@ NAME (aout, final_link) (bfd *abfd,
   /* Allocate buffers to hold section contents and relocs.  */
   aout_info.contents = (bfd_byte *) bfd_malloc (max_contents_size);
   aout_info.relocs = bfd_malloc (max_relocs_size);
-  aout_info.symbol_map = (int *) bfd_malloc (max_sym_count * sizeof (int *));
+  aout_info.symbol_map = (int *) bfd_malloc (max_sym_count * sizeof (int));
   aout_info.output_syms = (struct external_nlist *)
       bfd_malloc ((max_sym_count + 1) * sizeof (struct external_nlist));
   if ((aout_info.contents == NULL && max_contents_size != 0)
index 74c288425743bf8ae02521d7a5c1ac52a54a2ad8..64a3cee964ec8f7c3235fcdcafe651e865280e52 100644 (file)
@@ -661,10 +661,6 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
   if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd))
     return n_nfd;
 
-  /* Huh?  */
-  /* FIXME:  n_nfd isn't allocated in the archive's memory pool.
-     If we reach this point, I think bfd_release will abort.  */
-  bfd_release (archive, n_nfd);
   bfd_release (archive, new_areldata);
   return NULL;
 }
index 0907784a409088909511901a89959eddaaf3f940..59b1b8f6983817e2ce4c0a43bd55a5d6e73aeb7e 100644 (file)
@@ -1029,9 +1029,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section
 #define bfd_put_signed_8 \
   bfd_put_8
 #define bfd_get_8(abfd, ptr) \
-  (*(unsigned char *) (ptr) & 0xff)
+  (*(const unsigned char *) (ptr) & 0xff)
 #define bfd_get_signed_8(abfd, ptr) \
-  (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
+  (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
 
 #define bfd_put_16(abfd, val, ptr) \
   BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
index ce92781d505a8f4ee0c5efb16232b71119cfc4e8..dab8e88fb23cf2db09a6c6e9f0438084a9c63e1e 100644 (file)
@@ -1,7 +1,7 @@
 /* Low-level I/O routines for BFDs.
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
    Free Software Foundation, Inc.
 
    Written by Cygnus Support.
@@ -577,7 +577,7 @@ memory_bstat (bfd *abfd, struct stat *statbuf)
 {
   struct bfd_in_memory *bim = (struct bfd_in_memory *) abfd->iostream;
 
-  memset (statbuf, 0, sizeof (statbuf));
+  memset (statbuf, 0, sizeof (*statbuf));
   statbuf->st_size = bim->size;
 
   return 0;
index 052892445b3f0febda8b98909f111946486b75ee..fbffbed46d83bd3992da2aa1f003890714c98aa6 100644 (file)
@@ -105,7 +105,8 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,
          && (bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE)
              != (struct bfd_hash_entry *) NULL))
        {
-         if (! (*info->callbacks->notice) (info, h, abfd, section, value))
+         if (! (*info->callbacks->notice) (info, h, abfd, section, value,
+                                           flags, string))
            return FALSE;
        }
 
index 70f98512f9a4dabdbd0d7c7b054a3215a9ff6031..f1829a13ff1bfb735c895777ba1a8c6e813b18e2 100644 (file)
@@ -3295,6 +3295,8 @@ coff_compute_section_file_positions (bfd * abfd)
       if (!(current->flags & SEC_HAS_CONTENTS))
        continue;
 
+      current->rawsize = current->size;
+
 #ifdef COFF_IMAGE_WITH_PE
       /* Make sure we skip empty sections in a PE image.  */
       if (current->size == 0)
@@ -3361,7 +3363,7 @@ coff_compute_section_file_positions (bfd * abfd)
 
 #ifdef COFF_IMAGE_WITH_PE
       /* Set the padded size.  */
-      current->size = (current->size + page_size -1) & -page_size;
+      current->size = (current->size + page_size - 1) & -page_size;
 #endif
 
       sofar += current->size;
@@ -4852,7 +4854,7 @@ coff_slurp_symbol_table (bfd * abfd)
                 to the symbol instead of the index.  FIXME: This
                 should use a union.  */
              src->u.syment.n_value =
-               (long) (native_symbols + src->u.syment.n_value);
+               (long) (intptr_t) (native_symbols + src->u.syment.n_value);
              dst->symbol.value = src->u.syment.n_value;
              src->fix_value = 1;
              break;
index fc82d57dd73dd520811563497bf79f7e87708a4c..b0c2c62f1871e2651dec4e631b98b153e0b12bce 100644 (file)
@@ -915,6 +915,9 @@ coff_write_symbol (bfd *abfd,
   unsigned int numaux = native->u.syment.n_numaux;
   int type = native->u.syment.n_type;
   int n_sclass = (int) native->u.syment.n_sclass;
+  asection *output_section = symbol->section->output_section
+                              ? symbol->section->output_section
+                              : symbol->section;
   void * buf;
   bfd_size_type symesz;
 
@@ -933,7 +936,7 @@ coff_write_symbol (bfd *abfd,
 
   else
     native->u.syment.n_scnum =
-      symbol->section->output_section->target_index;
+      output_section->target_index;
 
   coff_fix_symbol_name (abfd, symbol, native, string_size_p,
                        debug_string_section_p, debug_string_size_p);
@@ -990,6 +993,9 @@ coff_write_alien_symbol (bfd *abfd,
 {
   combined_entry_type *native;
   combined_entry_type dummy;
+  asection *output_section = symbol->section->output_section
+                              ? symbol->section->output_section
+                              : symbol->section;
 
   native = &dummy;
   native->u.syment.n_type = T_NULL;
@@ -1015,12 +1021,11 @@ coff_write_alien_symbol (bfd *abfd,
     }
   else
     {
-      native->u.syment.n_scnum =
-       symbol->section->output_section->target_index;
+      native->u.syment.n_scnum = output_section->target_index;
       native->u.syment.n_value = (symbol->value
                                  + symbol->section->output_offset);
       if (! obj_pe (abfd))
-       native->u.syment.n_value += symbol->section->output_section->vma;
+       native->u.syment.n_value += output_section->vma;
 
       /* Copy the any flags from the file header into the symbol.
          FIXME: Why?  */
index 33de7fe3cc8aa97a99e35fa7d56bc061b41ea3eb..fdfab1de48f74109e875ae2aae39dc54aa9a184f 100644 (file)
@@ -2365,6 +2365,35 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd)
          if (internal_relocs == NULL)
            return FALSE;
 
+         /* Run through the relocs looking for relocs against symbols
+            coming from discarded sections and complain about them.  */
+         irel = internal_relocs;
+         for (; irel < &internal_relocs[o->reloc_count]; irel++)
+           {
+             struct coff_link_hash_entry *h;
+             asection *ps = NULL;
+             long symndx = irel->r_symndx;
+             if (symndx < 0)
+               continue;
+             h = obj_coff_sym_hashes (input_bfd)[symndx];
+             if (h == NULL)
+               continue;
+             while (h->root.type == bfd_link_hash_indirect
+                    || h->root.type == bfd_link_hash_warning)
+               h = (struct coff_link_hash_entry *) h->root.u.i.link;
+             if (h->root.type == bfd_link_hash_defined
+                 || h->root.type == bfd_link_hash_defweak)
+               ps = h->root.u.def.section;
+             if (ps == NULL)
+               continue;
+             /* Complain if definition comes from an excluded section.  */
+             if (ps->flags & SEC_EXCLUDE)
+               (*finfo->info->callbacks->einfo)
+                 (_("%X`%s' referenced in section `%A' of %B: "
+                    "defined in discarded section `%A' of %B\n"),
+                  h->root.root.string, o, input_bfd, ps, ps->owner);
+           }
+
          /* Call processor specific code to relocate the section
              contents.  */
          if (! bfd_coff_relocate_section (output_bfd, finfo->info,
index b0b97a27f497534f80c616010e5cdf30efc4e63e..98157e13e0b47dea7a81138bacd2c223cd8b5995 100644 (file)
 /* Define if <sys/procfs.h> has prpsinfo32_t. */
 #undef HAVE_PRPSINFO32_T
 
+/* Define if <sys/procfs.h> has prpsinfo32_t.pr_pid. */
+#undef HAVE_PRPSINFO32_T_PR_PID
+
 /* Define if <sys/procfs.h> has prpsinfo_t. */
 #undef HAVE_PRPSINFO_T
 
+/* Define if <sys/procfs.h> has prpsinfo_t.pr_pid. */
+#undef HAVE_PRPSINFO_T_PR_PID
+
 /* Define if <sys/procfs.h> has prstatus32_t. */
 #undef HAVE_PRSTATUS32_T
 
 /* Define if <sys/procfs.h> has psinfo32_t. */
 #undef HAVE_PSINFO32_T
 
+/* Define if <sys/procfs.h> has psinfo32_t.pr_pid. */
+#undef HAVE_PSINFO32_T_PR_PID
+
 /* Define if <sys/procfs.h> has psinfo_t. */
 #undef HAVE_PSINFO_T
 
+/* Define if <sys/procfs.h> has psinfo_t.pr_pid. */
+#undef HAVE_PSINFO_T_PR_PID
+
 /* Define if <sys/procfs.h> has pstatus32_t. */
 #undef HAVE_PSTATUS32_T
 
index 301def925a6bcde27d11e4838e2007e50d5ca196..63687e5d10ceb769fded5595aa87b39f2c947a3c 100755 (executable)
@@ -14387,6 +14387,43 @@ $as_echo "#define HAVE_PRPSINFO_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prpsinfo_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prpsinfo_t" >&6; }
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prpsinfo_t.pr_pid in sys/procfs.h" >&5
+$as_echo_n "checking for prpsinfo_t.pr_pid in sys/procfs.h... " >&6; }
+ if test "${bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+int
+main ()
+{
+prpsinfo_t avar; void* aref = (void*) &avar.pr_pid
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid=yes
+else
+  bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid = yes; then
+
+$as_echo "#define HAVE_PRPSINFO_T_PR_PID 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prpsinfo32_t in sys/procfs.h" >&5
 $as_echo_n "checking for prpsinfo32_t in sys/procfs.h... " >&6; }
  if test "${bfd_cv_have_sys_procfs_type_prpsinfo32_t+set}" = set; then :
@@ -14424,6 +14461,43 @@ $as_echo "#define HAVE_PRPSINFO32_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&6; }
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prpsinfo32_t.pr_pid in sys/procfs.h" >&5
+$as_echo_n "checking for prpsinfo32_t.pr_pid in sys/procfs.h... " >&6; }
+ if test "${bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+int
+main ()
+{
+prpsinfo32_t avar; void* aref = (void*) &avar.pr_pid
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid=yes
+else
+  bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid = yes; then
+
+$as_echo "#define HAVE_PRPSINFO32_T_PR_PID 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo_t in sys/procfs.h" >&5
 $as_echo_n "checking for psinfo_t in sys/procfs.h... " >&6; }
  if test "${bfd_cv_have_sys_procfs_type_psinfo_t+set}" = set; then :
@@ -14461,6 +14535,43 @@ $as_echo "#define HAVE_PSINFO_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psinfo_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_psinfo_t" >&6; }
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo_t.pr_pid in sys/procfs.h" >&5
+$as_echo_n "checking for psinfo_t.pr_pid in sys/procfs.h... " >&6; }
+ if test "${bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+int
+main ()
+{
+psinfo_t avar; void* aref = (void*) &avar.pr_pid
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid=yes
+else
+  bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid = yes; then
+
+$as_echo "#define HAVE_PSINFO_T_PR_PID 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo32_t in sys/procfs.h" >&5
 $as_echo_n "checking for psinfo32_t in sys/procfs.h... " >&6; }
  if test "${bfd_cv_have_sys_procfs_type_psinfo32_t+set}" = set; then :
@@ -14498,6 +14609,43 @@ $as_echo "#define HAVE_PSINFO32_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psinfo32_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_psinfo32_t" >&6; }
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo32_t.pr_pid in sys/procfs.h" >&5
+$as_echo_n "checking for psinfo32_t.pr_pid in sys/procfs.h... " >&6; }
+ if test "${bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+int
+main ()
+{
+psinfo32_t avar; void* aref = (void*) &avar.pr_pid
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid=yes
+else
+  bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid = yes; then
+
+$as_echo "#define HAVE_PSINFO32_T_PR_PID 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpstatus_t in sys/procfs.h" >&5
 $as_echo_n "checking for lwpstatus_t in sys/procfs.h... " >&6; }
  if test "${bfd_cv_have_sys_procfs_type_lwpstatus_t+set}" = set; then :
index 4076c6ef0a6ef32f2675ad915445440185f6c09e..0635810476056d9fb4b28a69ddf042baf121968e 100644 (file)
@@ -488,9 +488,13 @@ changequote([,])dnl
     BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t)
     BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t)
     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
+    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo_t, pr_pid)
     BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t)
+    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo32_t, pr_pid)
     BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
+    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo_t, pr_pid)
     BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t)
+    BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo32_t, pr_pid)
     BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
     BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
     BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
index e5d010349c9bd772123b65218dbec9bcbd344922..ca461b55dfeb8acd2b0b7eb44512b2b54f1ee15c 100644 (file)
@@ -2164,6 +2164,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
                  break;
 
                case DW_AT_abstract_origin:
+               case DW_AT_specification:
                  func->name = find_abstract_instance_name (unit, &attr);
                  break;
 
index 0c5b0cbd3499bfd5d8cba0406b489be3bfc5b034..6cba217f5d4239e3e2936126dd45894e7b601b72 100644 (file)
@@ -229,11 +229,7 @@ struct elf_link_hash_entry
 };
 
 /* Will references to this symbol always reference the symbol
-   in this object?  STV_PROTECTED is excluded from the visibility test
-   here so that function pointer comparisons work properly.  Since
-   function symbols not defined in an app are set to their .plt entry,
-   it's necessary for shared libs to also reference the .plt even
-   though the symbol is really local to the shared lib.  */
+   in this object?  */
 #define SYMBOL_REFERENCES_LOCAL(INFO, H) \
   _bfd_elf_symbol_refs_local_p (H, INFO, 0)
 
index bdca122e40f73ad0e875d09083b1db84ea9c9a06..30b5e02282e0b82f56302d54bcb14155d178fba9 100644 (file)
@@ -4882,6 +4882,22 @@ _bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela)
     }
 }
 
+/* Allocate space for an MN10300 extension to the bfd elf data structure.  */
+
+static bfd_boolean
+mn10300_elf_mkobject (bfd *abfd)
+{
+  /* We do not actually need any extra room in the bfd elf data structure.
+     But we do need the object_id of the structure to be set to
+     MN10300_ELF_DATA so that elflink.c:elf_link_add_object_symols() will call
+     our mn10300_elf_check_relocs function which will then allocate space in
+     the .got section for any GOT based relocs.  */
+  return bfd_elf_allocate_object (abfd, sizeof (struct elf_obj_tdata),
+                                 MN10300_ELF_DATA);
+}
+
+#define bfd_elf32_mkobject     mn10300_elf_mkobject
+
 #ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM      bfd_elf32_mn10300_vec
 #define TARGET_LITTLE_NAME     "elf32-mn10300"
index c0ffbd078b7a52cd9ce0d994e22df6f09f407448..b57f88ca3b91ac5427b9130fadee90de184e086e 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -976,7 +976,9 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
       phdr = elf_tdata (abfd)->phdr;
       for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)
        {
-         if (phdr->p_type == PT_LOAD
+         if (((phdr->p_type == PT_LOAD
+               && (hdr->sh_flags & SHF_TLS) == 0)
+              || phdr->p_type == PT_TLS)
              && ELF_SECTION_IN_SEGMENT (hdr, phdr))
            {
              if ((flags & SEC_LOAD) == 0)
@@ -3980,8 +3982,12 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
          phdr_in_segment = FALSE;
        }
 
-      /* Create a final PT_LOAD program segment.  */
-      if (last_hdr != NULL)
+      /* Create a final PT_LOAD program segment, but not if it's just
+        for .tbss.  */
+      if (last_hdr != NULL
+         && (i - phdr_index != 1
+             || ((last_hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD))
+                 != SEC_THREAD_LOCAL)))
        {
          m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment);
          if (m == NULL)
@@ -4661,11 +4667,24 @@ assign_file_positions_for_load_sections (bfd *abfd,
            }
          else
            {
-             if (p->p_type == PT_LOAD)
+             if (p->p_type == PT_LOAD
+                 || (this_hdr->sh_type == SHT_NOBITS
+                     && (this_hdr->sh_flags & SHF_TLS) != 0
+                     && this_hdr->sh_offset == 0))
                {
-                 this_hdr->sh_offset = sec->filepos = off;
-                 if (this_hdr->sh_type != SHT_NOBITS)
-                   off += this_hdr->sh_size;
+                 if (this_hdr->sh_type == SHT_NOBITS)
+                   {
+                     /* These sections don't really need sh_offset,
+                        but give them one anyway.  */
+                     bfd_vma adjust = vma_page_aligned_bias (this_hdr->sh_addr,
+                                                             off, align);
+                     this_hdr->sh_offset = sec->filepos = off + adjust;
+                   }
+                 else
+                   {
+                     this_hdr->sh_offset = sec->filepos = off;
+                     off += this_hdr->sh_size;
+                   }
                }
 
              if (this_hdr->sh_type != SHT_NOBITS)
@@ -4731,7 +4750,8 @@ assign_file_positions_for_load_sections (bfd *abfd,
 
              sec = m->sections[i];
              this_hdr = &(elf_section_data(sec)->this_hdr);
-             if (!ELF_SECTION_IN_SEGMENT_1 (this_hdr, p, check_vma, 0))
+             if (!ELF_SECTION_IN_SEGMENT_1 (this_hdr, p, check_vma, 0)
+                 && !ELF_TBSS_SPECIAL (this_hdr, p))
                {
                  (*_bfd_error_handler)
                    (_("%B: section `%A' can't be allocated in segment %d"),
@@ -4902,17 +4922,21 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
              && (p->p_type != PT_NOTE
                  || bfd_get_format (abfd) != bfd_core))
            {
-             Elf_Internal_Shdr *hdr;
-             asection *sect;
-
              BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs);
 
-             sect = m->sections[m->count - 1];
-             hdr = &elf_section_data (sect)->this_hdr;
-             p->p_filesz = sect->filepos - m->sections[0]->filepos;
-             if (hdr->sh_type != SHT_NOBITS)
-               p->p_filesz += hdr->sh_size;
+             p->p_filesz = 0;
              p->p_offset = m->sections[0]->filepos;
+             for (i = m->count; i-- != 0;)
+               {
+                 asection *sect = m->sections[i];
+                 Elf_Internal_Shdr *hdr = &elf_section_data (sect)->this_hdr;
+                 if (hdr->sh_type != SHT_NOBITS)
+                   {
+                     p->p_filesz = (sect->filepos - m->sections[0]->filepos
+                                    + hdr->sh_size);
+                     break;
+                   }
+               }
            }
        }
       else if (m->includes_filehdr)
@@ -7975,6 +7999,9 @@ elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
 
       memcpy (&psinfo, note->descdata, sizeof (psinfo));
 
+#if defined (HAVE_PSINFO_T_PR_PID) || defined (HAVE_PRPSINFO_T_PR_PID)
+      elf_tdata (abfd)->core_pid = psinfo.pr_pid;
+#endif
       elf_tdata (abfd)->core_program
        = _bfd_elfcore_strndup (abfd, psinfo.pr_fname,
                                sizeof (psinfo.pr_fname));
@@ -7991,6 +8018,9 @@ elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
 
       memcpy (&psinfo, note->descdata, sizeof (psinfo));
 
+#if defined (HAVE_PSINFO32_T_PR_PID) || defined (HAVE_PRPSINFO32_T_PR_PID)
+      elf_tdata (abfd)->core_pid = psinfo.pr_pid;
+#endif
       elf_tdata (abfd)->core_program
        = _bfd_elfcore_strndup (abfd, psinfo.pr_fname,
                                sizeof (psinfo.pr_fname));
index c7363753d497ecb28c75b615aa76cb4cd0cb0ded..42d9b46120bd2aca07cf37ee72ae61b0b063bcd3 100644 (file)
@@ -1881,6 +1881,8 @@ ppc_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
       return FALSE;
 
     case 128:          /* Linux/PPC elf_prpsinfo.  */
+      elf_tdata (abfd)->core_pid
+       = bfd_get_32 (abfd, note->descdata + 16);
       elf_tdata (abfd)->core_program
        = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
       elf_tdata (abfd)->core_command
index 65f13b3caf3b2164015e23dce4ef4cc2751b7379..99d22254bc6ea316093975a430b5448b474fcef4 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "sysdep.h"
 #include "bfd.h"
+#include "bfd_stdint.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/rx.h"
index 543a7272b286e4c48d273dda03f9cc38b44584a2..1394ff544e405d02b1219f39626214ee0f343619 100644 (file)
@@ -2670,6 +2670,8 @@ ppc64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
   if (note->descsz != 136)
     return FALSE;
 
+  elf_tdata (abfd)->core_pid
+    = bfd_get_32 (abfd, note->descdata + 24);
   elf_tdata (abfd)->core_program
     = _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
   elf_tdata (abfd)->core_command
index 5a9d457d38e0c90cf01dcd0e80347029c2218489..891ce5d7df4411f3a3e3dc90919e190b90fc21b9 100644 (file)
@@ -2881,8 +2881,10 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
     return TRUE;
 
   /* Function pointer equality tests may require that STV_PROTECTED
-     symbols be treated as dynamic symbols, even when we know that the
-     dynamic linker will resolve them locally.  */
+     symbols be treated as dynamic symbols.  If the address of a
+     function not defined in an executable is set to that function's
+     plt entry in the executable, then the address of the function in
+     a shared library must also be the plt entry in the executable.  */
   return local_protected;
 }
 
@@ -3814,7 +3816,7 @@ error_free_dyn:
       /* Make a special call to the linker "notice" function to
         tell it that we are about to handle an as-needed lib.  */
       if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
-                                      notice_as_needed))
+                                      notice_as_needed, 0, NULL))
        goto error_free_vers;
 
       /* Clone the symbol table and sym hashes.  Remember some
@@ -4240,10 +4242,7 @@ error_free_dyn:
                 We need to get the alignment from the section.  */
              align = new_sec->alignment_power;
            }
-         if (align > old_alignment
-             /* Permit an alignment power of zero if an alignment of one
-                is specified and no other alignments have been specified.  */
-             || (isym->st_value == 1 && old_alignment == 0))
+         if (align > old_alignment)
            h->root.u.c.p->alignment_power = align;
          else
            h->root.u.c.p->alignment_power = old_alignment;
@@ -4561,7 +4560,7 @@ error_free_dyn:
       /* Make a special call to the linker "notice" function to
         tell it that symbols added for crefs may need to be removed.  */
       if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
-                                      notice_not_needed))
+                                      notice_not_needed, 0, NULL))
        goto error_free_vers;
 
       free (old_tab);
@@ -4575,7 +4574,7 @@ error_free_dyn:
   if (old_tab != NULL)
     {
       if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
-                                      notice_needed))
+                                      notice_needed, 0, NULL))
        goto error_free_vers;
       free (old_tab);
       old_tab = NULL;
@@ -5724,11 +5723,12 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
            {
              const char *verstr, *name;
              size_t namelen, verlen, newlen;
-             char *newname, *p;
+             char *newname, *p, leading_char;
              struct elf_link_hash_entry *newh;
 
+             leading_char = bfd_get_symbol_leading_char (output_bfd);
              name = d->pattern;
-             namelen = strlen (name);
+             namelen = strlen (name) + (leading_char != '\0');
              verstr = t->name;
              verlen = strlen (verstr);
              newlen = namelen + verlen + 3;
@@ -5736,7 +5736,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
              newname = (char *) bfd_malloc (newlen);
              if (newname == NULL)
                return FALSE;
-             memcpy (newname, name, namelen);
+             newname[0] = leading_char;
+             memcpy (newname + (leading_char != '\0'), name, namelen);
 
              /* Check the hidden versioned definition.  */
              p = newname + namelen;
@@ -6538,10 +6539,13 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info)
            }
          else
            {
-             unsigned long int maskwords, maskbitslog2;
+             unsigned long int maskwords, maskbitslog2, x;
              BFD_ASSERT (cinfo.min_dynindx != -1);
 
-             maskbitslog2 = bfd_log2 (cinfo.nsyms) + 1;
+             x = cinfo.nsyms;
+             maskbitslog2 = 1;
+             while ((x >>= 1) != 0)
+               ++maskbitslog2;
              if (maskbitslog2 < 3)
                maskbitslog2 = 5;
              else if ((1 << (maskbitslog2 - 2)) & cinfo.nsyms)
index d42ad8921215647ad508a01b7e190aa3be48dc7f..26e591999e5f4d8dfc74c251f65dcc6d68f64d96 100644 (file)
@@ -636,7 +636,7 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
   bfd_byte *hit_addr;
 
   hit_addr = (bfd_byte *) (contents + off);
-  br_slot = (long) hit_addr & 0x3;
+  br_slot = (intptr_t) hit_addr & 0x3;
   hit_addr -= br_slot;
   t0 = bfd_getl64 (hit_addr + 0);
   t1 = bfd_getl64 (hit_addr + 8);
@@ -738,7 +738,7 @@ elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
   bfd_vma t0, t1, i0, i1, i2;
 
   hit_addr = (bfd_byte *) (contents + off);
-  hit_addr -= (long) hit_addr & 0x3;
+  hit_addr -= (intptr_t) hit_addr & 0x3;
   t0 = bfd_getl64 (hit_addr);
   t1 = bfd_getl64 (hit_addr + 8);
 
@@ -3874,7 +3874,7 @@ elfNN_ia64_install_value (bfd_byte *hit_addr, bfd_vma v,
   switch (opnd)
     {
     case IA64_OPND_IMMU64:
-      hit_addr -= (long) hit_addr & 0x3;
+      hit_addr -= (intptr_t) hit_addr & 0x3;
       t0 = bfd_getl64 (hit_addr);
       t1 = bfd_getl64 (hit_addr + 8);
 
@@ -3903,7 +3903,7 @@ elfNN_ia64_install_value (bfd_byte *hit_addr, bfd_vma v,
       break;
 
     case IA64_OPND_TGT64:
-      hit_addr -= (long) hit_addr & 0x3;
+      hit_addr -= (intptr_t) hit_addr & 0x3;
       t0 = bfd_getl64 (hit_addr);
       t1 = bfd_getl64 (hit_addr + 8);
 
@@ -3928,7 +3928,7 @@ elfNN_ia64_install_value (bfd_byte *hit_addr, bfd_vma v,
       break;
 
     default:
-      switch ((long) hit_addr & 0x3)
+      switch ((intptr_t) hit_addr & 0x3)
        {
        case 0: shift =  5; break;
        case 1: shift = 14; hit_addr += 3; break;
index 27901c5fbfab9d86774ed84a58ccc5daf3ba24bb..c32414068fa00f30daca651c3d218e748321ea67 100644 (file)
@@ -40,6 +40,8 @@ typedef unsigned int uint32_t;
 
 #undef HAVE_PRPSINFO32_T
 #define HAVE_PRPSINFO32_T
+#undef HAVE_PRPSINFO32_T_PR_PID
+#define HAVE_PRPSINFO32_T_PR_PID
 
 #undef HAVE_PRSTATUS32_T
 #define HAVE_PRSTATUS32_T
index 8b243784568d384b57fea97ab68fc4e3d84fc5dc..0c6755de7803d5b611dc6e89219b22886c125875 100644 (file)
@@ -431,9 +431,9 @@ DESCRIPTION
 .#define bfd_put_signed_8 \
 .  bfd_put_8
 .#define bfd_get_8(abfd, ptr) \
-.  (*(unsigned char *) (ptr) & 0xff)
+.  (*(const unsigned char *) (ptr) & 0xff)
 .#define bfd_get_signed_8(abfd, ptr) \
-.  (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
+.  (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
 .
 .#define bfd_put_16(abfd, val, ptr) \
 .  BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
@@ -968,8 +968,12 @@ bfd_log2 (bfd_vma x)
 {
   unsigned int result = 0;
 
-  while ((x = (x >> 1)) != 0)
+  if (x <= 1)
+    return result;
+  --x;
+  do
     ++result;
+  while ((x >>= 1) != 0);
   return result;
 }
 
index 1f02cbab545cf64d663a4d23f6f2c65f1d8d7bea..283287a0fb5119f1af13193298c08519ce77e038 100644 (file)
@@ -1607,7 +1607,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
       || (info->notice_hash != NULL
          && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
     {
-      if (! (*info->callbacks->notice) (info, h, abfd, section, value))
+      if (! (*info->callbacks->notice) (info, h,
+                                       abfd, section, value, flags, string))
        return FALSE;
     }
 
@@ -1640,7 +1641,6 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
          /* Make a new weak undefined symbol.  */
          h->type = bfd_link_hash_undefweak;
          h->u.undef.abfd = abfd;
-         h->u.undef.weak = abfd;
          break;
 
        case CDEF:
index a5b7f68b902d91229dcd820fbc09993955f29a97..3583b91f449923543a6f87a2109a6b5fbab8725a 100644 (file)
@@ -2449,15 +2449,23 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
 
     if (sec)
       {
-       bfd_size_type x = sec->rawsize ? sec->rawsize : sec->size;
+       bfd_size_type x = sec->rawsize;
+       bfd_byte *tmp_data = NULL;
 
-       if (x && bfd_get_section_contents (abfd, sec, pfinfo->contents, 0, x))
+       if (x)
+         tmp_data = bfd_malloc (x);
+
+       if (tmp_data != NULL)
          {
-           qsort (pfinfo->contents,
-                  (size_t) ((sec->size <x ? sec->size : x) / 12),
-                  12, sort_x64_pdata);
-           bfd_set_section_contents (pfinfo->output_bfd, sec,
-                                     pfinfo->contents, 0, x);
+           if (bfd_get_section_contents (abfd, sec, tmp_data, 0, x))
+             {
+               qsort (tmp_data,
+                      (size_t) (x / 12),
+                      12, sort_x64_pdata);
+               bfd_set_section_contents (pfinfo->output_bfd, sec,
+                                         tmp_data, 0, x);
+             }
+           free (tmp_data);
          }
       }
   }
index 309c3a241be06665e0fb439d3d58d6936f7cd0f4..322de62c2bd35e877367d10e19bb2e7e428ceb5d 100644 (file)
@@ -1709,7 +1709,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct bfd_link_info *info)
 #if VMS_DEBUG
       _bfd_vms_debug (4, "etir: %s(%d)\n",
                       _bfd_vms_etir_name (cmd), cmd);
-      _bfd_hexdump (8, ptr, cmd_length - 4, (long) ptr);
+      _bfd_hexdump (8, ptr, cmd_length - 4, (intptr_t) ptr);
 #endif
 
       switch (cmd)
index 13ef346c8824d3d3ed0cafd880caf8d895757d6a..0b3a1a00b41faf303838c1148464cd84616f641e 100644 (file)
@@ -1,3 +1,21 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-05-18  Nick Clifton  <nickc@redhat.com>
+       PR binutils/12753
+       * nm.c (filter_symbols): Treat unique symbols as global symbols.
+       * doc/binutils.texi (nm): Mention that some lowercase letters
+       actually indicate global symbols.
+
+       2011-05-07  Alan Modra  <amodra@gmail.com>
+       * objcopy.c (copy_archive): Check bfd_openw result in unknown object
+       case.  Rewrite without goto.
+
+       2011-04-03  H.J. Lu  <hongjiu.lu@intel.com>
+       PR binutils/12632
+       * objcopy.c (copy_unknown_object): Make the archive element
+       readable.
+
 2011-03-01  Akos Pasztory  <akos.pasztory@gmail.com>
 
        PR binutils/12523
index d3285a5ead8b195ace020fdd3889218b00e1f75e..d8d1899caedb3d690915a66678f05afa0fbc99c2 100644 (file)
@@ -724,7 +724,9 @@ hexadecimal by default.
 @item
 The symbol type.  At least the following types are used; others are, as
 well, depending on the object file format.  If lowercase, the symbol is
-local; if uppercase, the symbol is global (external).
+usually local; if uppercase, the symbol is global (external).  There
+are however a few lowercase symbols that are shown for special global
+symbols (@code{u}, @code{v} and @code{w}).
 
 @c Some more detail on exactly what these symbol types are used for
 @c would be nice.
index 3b75edf3cd8e41000e2a6d733d92e90ea1aa15ea..783087dd89b0455d795d6fb1bdecf04b279cd2cc 100644 (file)
@@ -436,6 +436,8 @@ filter_symbols (bfd *abfd, bfd_boolean is_dynamic, void *minisyms,
       else if (external_only)
        keep = ((sym->flags & BSF_GLOBAL) != 0
                || (sym->flags & BSF_WEAK) != 0
+               /* PR binutls/12753: Unique symbols are global too.  */
+               || (sym->flags & BSF_GNU_UNIQUE) != 0
                || bfd_is_und_section (sym->section)
                || bfd_is_com_section (sym->section));
       else
index ac176df589641982c2c3fdcdb2e87599a8e2b01f..54f070d8dadb0c978582983ddb0962339a2d73b4 100644 (file)
@@ -1,6 +1,6 @@
 /* objcopy.c -- copy object file from input to output, optionally massaging it.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -1399,7 +1399,9 @@ copy_unknown_object (bfd *ibfd, bfd *obfd)
       ncopied += tocopy;
     }
 
-  chmod (bfd_get_filename (obfd), buf.st_mode);
+  /* We should at least to be able to read it back when copying an
+     unknown object in an archive.  */
+  chmod (bfd_get_filename (obfd), buf.st_mode | S_IRUSR);
   free (cbuf);
   return TRUE;
 }
@@ -2022,6 +2024,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target,
       struct stat buf;
       int stat_status = 0;
       bfd_boolean del = TRUE;
+      bfd_boolean ok_object;
 
       /* Create an output file for this member.  */
       output_name = concat (dir, "/",
@@ -2059,44 +2062,42 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target,
       l->obfd = NULL;
       list = l;
 
-      if (bfd_check_format (this_element, bfd_object))
+      ok_object = bfd_check_format (this_element, bfd_object);
+      if (!ok_object)
+       bfd_nonfatal_message (NULL, this_element, NULL,
+                             _("Unable to recognise the format of file"));
+
+      /* PR binutils/3110: Cope with archives
+        containing multiple target types.  */
+      if (force_output_target || !ok_object)
+       output_bfd = bfd_openw (output_name, output_target);
+      else
+       output_bfd = bfd_openw (output_name, bfd_get_target (this_element));
+
+      if (output_bfd == NULL)
        {
-         /* PR binutils/3110: Cope with archives
-            containing multiple target types.  */
-         if (force_output_target)
-           output_bfd = bfd_openw (output_name, output_target);
-         else
-           output_bfd = bfd_openw (output_name, bfd_get_target (this_element));
+         bfd_nonfatal_message (output_name, NULL, NULL, NULL);
+         status = 1;
+         return;
+       }
+
+      if (ok_object)
+       {
+         del = !copy_object (this_element, output_bfd, input_arch);
 
-         if (output_bfd == NULL)
+         if (del && bfd_get_arch (this_element) == bfd_arch_unknown)
+           /* Try again as an unknown object file.  */
+           ok_object = FALSE;
+         else if (!bfd_close (output_bfd))
            {
              bfd_nonfatal_message (output_name, NULL, NULL, NULL);
+             /* Error in new object file. Don't change archive.  */
              status = 1;
-             return;
            }
-
-         del = ! copy_object (this_element, output_bfd, input_arch);
-
-         if (! del
-             || bfd_get_arch (this_element) != bfd_arch_unknown)
-           {
-             if (!bfd_close (output_bfd))
-               {
-                 bfd_nonfatal_message (output_name, NULL, NULL, NULL);
-                 /* Error in new object file. Don't change archive.  */
-                 status = 1;
-               }
-           }
-         else
-           goto copy_unknown_element;
        }
-      else
-       {
-         bfd_nonfatal_message (NULL, this_element, NULL,
-                               _("Unable to recognise the format of file"));
 
-         output_bfd = bfd_openw (output_name, output_target);
-copy_unknown_element:
+      if (!ok_object)
+       {
          del = !copy_unknown_object (this_element, output_bfd);
          if (!bfd_close_all_done (output_bfd))
            {
index 678f82aef04b2d43cdca5ad084088addb43f5fd3..0b6a0a1ede9dcfe1d9d4d0cce658a723a3f9e712 100644 (file)
@@ -1,3 +1,12 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-05-18  Nick Clifton  <nickc@redhat.com>
+       PR binutils/12753
+       * lib/utils-lib.exp (run_dump_test): Allow nm as a program.
+       * binutils-all/nm.exp: Test running "nm -g" on an object file
+       containing a unique symbol.
+
 2011-02-10  Alan Modra  <amodra@gmail.com>
 
        Apply from mainline
index 67d0cbdc0874b9865cc9f61a1be74810926af5a0..685794d323568479fcc867b34bd197a509e62ed4 100644 (file)
@@ -98,6 +98,41 @@ if {![info exists vars(text_symbol)] \
     pass "nm -g"
 }
 
+if [is_elf_format] {
+    # PR binutils/12753
+    # Test nm -g on a unique global symbol.
+
+    # Only some targets support unique symbols.
+    if {([istarget "i?86-*-*"]
+        || [istarget "x86_64-*-*"]
+        || [istarget "arm-*-*"]
+        || [istarget "powerpc*-*-*"]
+        || [istarget "sparc*-*-*"])} then {
+
+       if {![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o]} then {
+           fail "nm -g on unique symbols (assembling)"
+       } else {
+           if [is_remote host] {
+               set tmpfile [remote_download host tmpdir/unique.o]
+           } else {
+               set tmpfile tmpdir/unique.o
+           }
+       
+           set got [binutils_run $NM "$NMFLAGS -g $tmpfile"]
+
+           if [regexp "u foo" $got] then {
+               pass "nm -g on unique symbols"
+           } else {
+               fail "nm -g on unique symbols"
+           }
+
+           if { $verbose < 1 } {
+               remote_file host delete "tmpdir/unique.o"
+           }
+       }
+   }
+}
+
 # Test nm -P
 
 # This test does not work correctly on ECOFF targets, because ECOFF
index 72e368cbb393d08779a450b054ec4833d5b67e95..b96043b4d76d58d857d9b3d884bf14fe6b122adf 100644 (file)
@@ -354,6 +354,7 @@ proc run_dump_test { name {extra_options {}} } {
        }
        strings { set program strings }
        elfedit { set program elfedit }
+       nm      { set program nm }
        default {
            perror "unrecognized program option $opts(PROG) in $file.d"
            unresolved $testname
index 827ea36bff5feb9205184641a41ba26e236cd70b..596029fe78631a3f3bc42ab7aacbe44e740ae706 100644 (file)
@@ -1,3 +1,28 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-03-18  Alan Modra  <amodra@gmail.com>
+       * input-scrub.c (line_numberT): Delete.
+       (input_scrub_close): Reset line counters.
+       * messages.c (as_show_where): Don't print invalid line number.
+       (as_warn_internal, as_bad_internal): Likewise.
+
+       2011-03-18  Alan Modra  <amodra@gmail.com>
+       * read.c (read_a_source_file): Remove md_after_pass_hook.
+       Move "quit" label before set of dot_symbol.
+       * config/tc-d10v.h (md_after_pass_hook): Don't define.
+       * config/tc-d30v.h (md_after_pass_hook): Likewise.
+       * config/tc-m32r.h (md_after_pass_hook): Likewise.
+       (md_cleanup): Define to call m32r_fill_insn.
+
+       2011-03-10  Alan Modra  <amodra@gmail.com>
+       * gas/config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS,
+       TARGET_SYMBOL_FIELDS): Don't define.
+       * gas/config/tc-arc.c (arc_common): Use correct symbol "local" field.
+
+       2011-03-09  Michael Snyder  <msnyder@vmware.com>
+       * dwarf2dbg.c (emit_fixed_inc_line_addr): Correct assert.
+
 2011-05-18  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        Backported from mainline
index ccfa8d294c9fa65613e781d4f14b037e49e3e915..0721654c0433495fbd5e96ae42849d82e5914960 100644 (file)
@@ -1,6 +1,7 @@
 /* ELF object file format.
    Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007, 2009  Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -80,14 +81,6 @@ struct elf_obj_sy
 
 #define OBJ_SYMFIELD_TYPE struct elf_obj_sy
 
-/* Symbol fields used by the ELF back end.  */
-#define ELF_TARGET_SYMBOL_FIELDS unsigned int local:1;
-
-/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead.  */
-#ifndef TARGET_SYMBOL_FIELDS
-#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
-#endif
-
 #ifndef FALSE
 #define FALSE 0
 #define TRUE  !FALSE
index b5d073efe7861279979dfb7389fdb5f8a77338a9..8d2da96bc7b440d272cd2c11869f2938539e4f2d 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-arc.c -- Assembler for the ARC
    Copyright 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006, 2007, 2009  Free Software Foundation, Inc.
+   2006, 2007, 2009, 2011  Free Software Foundation, Inc.
    Contributed by Doug Evans (dje@cygnus.com).
 
    This file is part of GAS, the GNU Assembler.
@@ -934,7 +934,7 @@ arc_common (int localScope)
       S_SET_SIZE       (symbolP, size);
       S_SET_SEGMENT    (symbolP, bss_section);
       S_CLEAR_EXTERNAL (symbolP);
-      symbolP->local = 1;
+      symbol_get_obj (symbolP)->local = 1;
       subseg_set (old_sec, old_subsec);
     }
   else
index 930f3a185dd89ecb167b7c069ac1d4ee0d95f855..3c326248f317576b32310ce3bd6fd1ddcaa4a1d1 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-d10v.h -- Header file for tc-d10v.c.
    Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2007, 2009,
-   2010 Free Software Foundation, Inc.
+   2010, 2011 Free Software Foundation, Inc.
    Written by Martin Hunt, Cygnus Support.
 
    This file is part of GAS, the GNU Assembler.
@@ -47,7 +47,6 @@ long md_pcrel_from_section (struct fix *, segT);
 
 int d10v_cleanup (void);
 void d10v_frob_label (symbolS *);
-#define md_after_pass_hook()        d10v_cleanup ()
 #define md_cleanup()                d10v_cleanup ()
 #define md_do_align(a,b,c,d,e)      d10v_cleanup ()
 #define tc_frob_label(sym)          d10v_frob_label (sym)
index 51935502d667855a7a191c17b3e55c11d4ffdf87..e75f3d81d0d401155beb1f6b8aaa6ec939d50325 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-310v.h -- Header file for tc-d30v.c.
-   Copyright 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009
+   Copyright 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009, 2011
    Free Software Foundation, Inc.
    Written by Martin Hunt, Cygnus Support.
 
@@ -46,7 +46,6 @@ extern long md_pcrel_from_section (struct fix *, segT);
 #define md_number_to_chars           number_to_chars_bigendian
 
 int d30v_cleanup (int);
-#define md_after_pass_hook()        d30v_cleanup (FALSE)
 #define md_cleanup()                d30v_cleanup (FALSE)
 #define TC_START_LABEL(ch, s, ptr)      (ch == ':' && d30v_cleanup (FALSE))
 void d30v_start_line (void);
index 9def7ba2c747703a3905af124e51ca3c1b5c9bb0..326571227589350a9b99af3d22be3069440c1bc6 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-m32r.h -- Header file for tc-m32r.c.
    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2007, 2009 Free Software Foundation, Inc.
+   2007, 2009, 2011 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -101,10 +101,9 @@ extern int m32r_force_relocation (struct fix *);
 
 /* Ensure insns at labels are aligned to 32 bit boundaries.  */
 int m32r_fill_insn (int);
-#define md_after_pass_hook()   m32r_fill_insn (1)
 #define TC_START_LABEL(ch, s, ptr)     (ch == ':' && m32r_fill_insn (0))
 
-#define md_cleanup                 m32r_elf_section_change_hook
+#define md_cleanup()               m32r_fill_insn (1)
 #define md_elf_section_change_hook m32r_elf_section_change_hook
 extern void m32r_elf_section_change_hook (void);
 
index 85c1f30e89898c8d70f9752523c15825058abed4..9910c17a810146a5441b93950e04b26c36041402 100644 (file)
@@ -1080,7 +1080,7 @@ emit_fixed_inc_line_addr (int line_delta, addressT addr_delta, fragS *frag,
       symbolS *to_sym;
       expressionS exp;
 
-      gas_assert (pexp->X_op = O_subtract);
+      gas_assert (pexp->X_op == O_subtract);
       to_sym = pexp->X_add_symbol;
 
       *p++ = DW_LNS_extended_op;
index e1ff5cc0a505d48840692c326811709ce19938b4..d00b116d536628c3a50de305e8b72b2fb22da16c 100644 (file)
@@ -1,6 +1,6 @@
 /* input_scrub.c - Break up input buffers into whole numbers of lines.
    Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   2000, 2001, 2003, 2005, 2006, 2007, 2008
+   2000, 2001, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -99,10 +99,9 @@ int macro_nest;
 static char *physical_input_file;
 static char *logical_input_file;
 
-typedef unsigned int line_numberT;     /* 1-origin line number in a source file.  */
+/* 1-origin line number in a source file.  */
 /* A line ends in '\n' or eof.  */
-
-static line_numberT physical_input_line;
+static unsigned int physical_input_line;
 static int logical_input_line;
 
 /* Struct used to save the state of the input handler during include files */
@@ -114,7 +113,7 @@ struct input_save {
   unsigned int        buffer_length;
   char *              physical_input_file;
   char *              logical_input_file;
-  line_numberT        physical_input_line;
+  unsigned int        physical_input_line;
   int                 logical_input_line;
   int                 sb_index;
   sb                  from_sb;
@@ -303,6 +302,8 @@ void
 input_scrub_close (void)
 {
   input_file_close ();
+  physical_input_line = 0;
+  logical_input_line = -1;
 }
 
 char *
index 9ea1bce26dcdfb0c8dca15cdfc02a783e14dc5cc..e1734f250639f613211f7fb0b0067b95c428cc56 100644 (file)
@@ -1,6 +1,6 @@
 /* messages.c - error reporter -
    Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
-   2003, 2004, 2005, 2006, 2007, 2008
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of GAS, the GNU Assembler.
 
@@ -113,7 +113,12 @@ as_show_where (void)
   as_where (&file, &line);
   identify (file);
   if (file)
-    fprintf (stderr, "%s:%u: ", file, line);
+    {
+      if (line != 0)
+       fprintf (stderr, "%s:%u: ", file, line);
+      else
+       fprintf (stderr, "%s: ", file);
+    }
 }
 
 /* Send to stderr a string as a warning, and locate warning
@@ -146,7 +151,12 @@ as_warn_internal (char *file, unsigned int line, char *buffer)
 
   identify (file);
   if (file)
-    fprintf (stderr, "%s:%u: ", file, line);
+    {
+      if (line != 0)
+       fprintf (stderr, "%s:%u: ", file, line);
+      else
+       fprintf (stderr, "%s: ", file);
+    }
   fprintf (stderr, _("Warning: "));
   fputs (buffer, stderr);
   (void) putc ('\n', stderr);
@@ -207,7 +217,12 @@ as_bad_internal (char *file, unsigned int line, char *buffer)
 
   identify (file);
   if (file)
-    fprintf (stderr, "%s:%u: ", file, line);
+    {
+      if (line != 0)
+       fprintf (stderr, "%s:%u: ", file, line);
+      else
+       fprintf (stderr, "%s: ", file);
+    }
   fprintf (stderr, _("Error: "));
   fputs (buffer, stderr);
   (void) putc ('\n', stderr);
index 7a5e512bb3722007f1736598e95337637f616212..d224d1658e2ef6a4e4c5d3bec050eca620ce3353 100644 (file)
@@ -1124,14 +1124,10 @@ read_a_source_file (char *name)
          /* Report unknown char as error.  */
          demand_empty_rest_of_line ();
        }
-
-#ifdef md_after_pass_hook
-      md_after_pass_hook ();
-#endif
     }
-  symbol_set_value_now (&dot_symbol);
 
  quit:
+  symbol_set_value_now (&dot_symbol);
 
 #ifdef md_cleanup
   md_cleanup ();
index a467b632e950382304accbee8550e1a753712a31..356db301ab5d258830e313e73944a8901ef2846a 100644 (file)
@@ -1,3 +1,10 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-03-18  Alan Modra  <amodra@gmail.com>
+       * gas/i386/inval-equ-2.l: Adjust expected error.
+       * gas/symver/symver2.l: Likewise.
+
 2011-05-18  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        Backported from mainline
@@ -9,7 +16,7 @@
 
 2011-05-13  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
-       Apply from mainline. 
+       Apply from mainline.
        2011-05-12  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
        PR gas/12715
        * gas/arm/neon-const.s: Add testcase for 64-bit Neon constants.
index d598d0b80ee24f2108689bf546ea55edc5450b80..aed89b4f5ee850ba5fd65d131740294f868712bf 100644 (file)
@@ -1,7 +1,7 @@
 .*: Assembler messages:
-.*:8: Error: .*
-.*:8: Error: .*
-.*:8: Error: .*
+.*: Error: .*
+.*: Error: .*
+.*: Error: .*
 GAS LISTING .*
 
 
index 216b4870b6b37094d25b42203aa9641a852c635c..f9d73d76166e3ea6d40fb1b93113ba54e899c274 100644 (file)
@@ -1,2 +1,2 @@
 .*: Assembler messages:
-.*:8: Error: invalid attempt to declare external version name as default in symbol `foo@@version1'
+.*: Error: invalid attempt to declare external version name as default in symbol `foo@@version1'
index 684e7b5d99f65e7409f809e96ae78da53348b455..1cf4f0b8abd24c7d454cff0f4f468b697261e25e 100644 (file)
@@ -1,3 +1,18 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-05-17  Alan Modra  <amodra@gmail.com>
+       PR ld/12760
+       * bfdlink.h (struct bfd_link_callbacks <notice>): Add "flags" and
+       "string" param.
+
+       2011-05-16  Alan Modra  <amodra@gmail.com>
+       * bfdlink.h (struct bfd_link_hash_entry): Remove u.undef.weak field.
+
+       2011-04-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * bfdlink.h (ENUM_BITFIELD): Remove.
+       * ansidecl.h (ENUM_BITFIELD): New, from gcc/system.h.
+
 2011-04-27  Alan Modra  <amodra@gmail.com>
 
        Backport from mainline.
index 8b76647426bf9641c0b0c969efa23d2886831b8c..c39ce2f5d709ed3c5dc92f01bb0a5e5f7e996617 100644 (file)
@@ -416,6 +416,15 @@ So instead we use the macro below and test it against specific values.  */
 #define EXPORTED_CONST const
 #endif
 
+/* Be conservative and only use enum bitfields with GCC.
+   FIXME: provide a complete autoconf test for buggy enum bitfields.  */
+
+#if (GCC_VERSION > 2000)
+#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
+#else
+#define ENUM_BITFIELD(TYPE) unsigned int
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 66f76455b19ed66de60ba6f536b163d829f8569d..22c29eae727bea6d02899f37b926192389a121ac 100644 (file)
 #ifndef BFDLINK_H
 #define BFDLINK_H
 
-#if (__GNUC__ * 1000 + __GNUC_MINOR__ > 2000)
-#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
-#else
-#define ENUM_BITFIELD(TYPE) unsigned int
-#endif
-
 /* Which symbols to strip during a link.  */
 enum bfd_link_strip
 {
@@ -128,7 +122,6 @@ struct bfd_link_hash_entry
             undefined symbol list.  */
          struct bfd_link_hash_entry *next;
          bfd *abfd;            /* BFD symbol was found in.  */
-         bfd *weak;            /* BFD weak symbol was found in.  */
        } undef;
       /* bfd_link_hash_defined, bfd_link_hash_defweak.  */
       struct
@@ -579,10 +572,13 @@ struct bfd_link_callbacks
   /* A function which is called when a symbol in notice_hash is
      defined or referenced.  H is the symbol.  ABFD, SECTION and
      ADDRESS are the (new) value of the symbol.  If SECTION is
-     bfd_und_section, this is a reference.  */
+     bfd_und_section, this is a reference.  FLAGS are the symbol
+     BSF_* flags.  STRING is the name of the symbol to indirect to if
+     the sym is indirect, or the warning string if a warning sym.  */
   bfd_boolean (*notice)
     (struct bfd_link_info *, struct bfd_link_hash_entry *h,
-     bfd *abfd, asection *section, bfd_vma address);
+     bfd *abfd, asection *section, bfd_vma address, flagword flags,
+     const char *string);
   /* Error or warning link info message.  */
   void (*einfo)
     (const char *fmt, ...);
index 13eaa9bb815c8d1b9da434ea753a331e4cce72a1..4484c3da2cc2edc94f87fea9b7f59f0fca3efff9 100644 (file)
@@ -1,3 +1,54 @@
+2011-05-29  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-05-23  Alan Modra  <amodra@gmail.com>
+       PR 12763
+       * ldlang.c (lang_output_section_find_by_flags): Match orphan .sdata2
+       like sections to existing .sdata2, and similarly for orphan TLS
+       sections.
+       * emultempl/elf32.em (place_orphan): Exclude .tbss from orphan_bss.
+
+       2011-05-17  Alan Modra  <amodra@gmail.com>
+       PR ld/12760
+       * ldmain.c (notice): Add "flags" and "string" param.
+       * plugin.c (plugin_notice): Likewise.  Handle indirect, warning
+       and constructor syms.
+
+       2010-05-16  Daniel Jacobowitz  <dan@codesourcery.com>
+       * ldlang.c (print_assignment): Use the symbol's section if we
+       use its value.
+       * ldexp.c (exp_fold_tree_1): Skip self-assignment.  Expand
+       comment on copying symbol type.
+
+       2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
+       PR ld/12365
+       * scripttempl/pe.sc (__rt_psrelocs_start): New symbol definition.
+       (__rt_psrelocs_end): Likewise.
+       (__rt_psrelocs_size): Likewise difference between the above.
+       (__RUNTIME_PSEUDO_RELOC_LIST_END__): Move outside .rdata section
+       immediately after end of pseudo-reloc data.
+       (___RUNTIME_PSEUDO_RELOC_LIST_END___): Likewise.
+       (__RUNTIME_PSEUDO_RELOC_LIST__): Move outside .rdata section and
+       calculate backward from list end.
+       (___RUNTIME_PSEUDO_RELOC_LIST___): Likewise.
+       * scripttempl/pep.sc: Likewise.
+
+       2011-03-29  Alan Modra  <amodra@gmail.com>
+       PR ld/12613
+       * ldlex.l (lex_warn_invalid): Don't assume char is unsigned.
+
+       2011-03-10  Dave Korn  <dave.korn.cygwin@gmail.com>
+       * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Preserve
+       alignment of input sections when creating orphan output sections
+       during relocatable link.
+       * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+
+       2011-02-14  Mike Frysinger  <vapier@gentoo.org>
+       * ldlang.c (lang_vers_match): Declare a new c_sym, assign it to
+       the bfd_demangle of sym, change users of sym to c_sym when not
+       already demangling, and free when done.  Change callers of
+       cplus_demangle to bfd_demangle.
+
 2011-05-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/12760
index ddcd5901fd610f88e08ea5354a58f22dfe807e8a..62a86ca2178426ab6dfde0241b423552fda17ecb 100644 (file)
@@ -1919,7 +1919,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
           && ((iself && sh_type == SHT_NOTE)
               || (!iself && CONST_STRNEQ (secname, ".note"))))
     place = &hold[orphan_interp];
-  else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
+  else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) == 0)
     place = &hold[orphan_bss];
   else if ((s->flags & SEC_SMALL_DATA) != 0)
     place = &hold[orphan_sdata];
index f9085f2fe765bdfad840a7f23dbb72cc9a0626d3..cad49d28a5b7bb0fdf5ab63c9fec7351af76e679 100644 (file)
@@ -2009,10 +2009,17 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
                     ->output_section_statement);
        }
 
-      /* All sections in an executable must be aligned to a page boundary.  */
+      /* All sections in an executable must be aligned to a page boundary.
+        In a relocatable link, just preserve the incoming alignment; the
+        address is discarded by lang_insert_orphan in that case, anyway.  */
       address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
       os = lang_insert_orphan (s, secname, constraint, after, place, address,
                               &add_child);
+      if (link_info.relocatable)
+       {
+         os->section_alignment = s->alignment_power;
+         os->bfd_section->alignment_power = s->alignment_power;
+       }
     }
 
   /* If the section name has a '\$', sort it with the other '\$'
index 90793ea9b632c048cac3aa3cb13142f6410ee7c2..78751bb71b3088c9296e8f613710068de808d3a6 100644 (file)
@@ -1745,10 +1745,17 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
                     ->output_section_statement);
        }
 
-      /* All sections in an executable must be aligned to a page boundary.  */
+      /* All sections in an executable must be aligned to a page boundary.
+        In a relocatable link, just preserve the incoming alignment; the
+        address is discarded by lang_insert_orphan in that case, anyway.  */
       address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
       os = lang_insert_orphan (s, secname, constraint, after, place, address,
                               &add_child);
+      if (link_info.relocatable)
+       {
+         os->section_alignment = s->alignment_power;
+         os->bfd_section->alignment_power = s->alignment_power;
+       }
     }
 
   /* If the section name has a '\$', sort it with the other '\$'
index f70634c5c616bf935e8dd53d4eeee21160aa2dea..68617d8553f3990dc2592d0dcc0c47234f0f9f54 100644 (file)
@@ -832,6 +832,8 @@ exp_fold_tree_1 (etree_type *tree)
        }
       else
        {
+         etree_type *name;
+
          struct bfd_link_hash_entry *h = NULL;
 
          if (tree->type.node_class == etree_provide)
@@ -849,6 +851,23 @@ exp_fold_tree_1 (etree_type *tree)
                }
            }
 
+         name = tree->assign.src;
+         if (name->type.node_class == etree_trinary)
+           {
+             exp_fold_tree_1 (name->trinary.cond);
+             if (expld.result.valid_p)
+               name = (expld.result.value
+                       ? name->trinary.lhs : name->trinary.rhs);
+           }
+
+         if (name->type.node_class == etree_name
+             && name->type.node_code == NAME
+             && strcmp (tree->assign.dst, name->name.name) == 0)
+           /* Leave it alone.  Do not replace a symbol with its own
+              output address, in case there is another section sizing
+              pass.  Folding does not preserve input sections.  */
+           break;
+
          exp_fold_tree_1 (tree->assign.src);
          if (expld.result.valid_p
              || (expld.phase == lang_first_phase_enum
@@ -876,7 +895,8 @@ exp_fold_tree_1 (etree_type *tree)
                tree->type.node_class = etree_provided;
 
              /* Copy the symbol type if this is a simple assignment of
-                one symbol to annother.  */
+                one symbol to another.  This could be more general
+                (e.g. a ?: operator with NAMEs in each branch).  */
              if (tree->assign.src->type.node_class == etree_name)
                {
                  struct bfd_link_hash_entry *hsrc;
index cba509b84e5b87f64f67b4815874170696f3dd8d..8b05d8e1203a406cc28c0f8172bca54b8eb43bc7 100644 (file)
@@ -1526,8 +1526,14 @@ lang_output_section_find_by_flags (const asection *sec,
            }
          flags ^= sec->flags;
          if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
-                        | SEC_READONLY))
-             && !(look->flags & (SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
+                        | SEC_READONLY | SEC_SMALL_DATA))
+             || (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
+                            | SEC_READONLY))
+                 && !(look->flags & SEC_SMALL_DATA))
+             || (!(flags & (SEC_THREAD_LOCAL | SEC_ALLOC))
+                 && (look->flags & SEC_THREAD_LOCAL)
+                 && (!(flags & SEC_LOAD)
+                     || (look->flags & SEC_LOAD))))
            found = look;
        }
     }
@@ -3995,9 +4001,8 @@ print_assignment (lang_assignment_statement_type *assignment,
          if (h)
            {
              value = h->u.def.value;
-
-             if (expld.result.section != NULL)
-               value += expld.result.section->vma;
+             value += h->u.def.section->output_section->vma;
+             value += h->u.def.section->output_offset;
 
              minfo ("[0x%V]", value);
            }
@@ -7387,19 +7392,29 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
                 struct bfd_elf_version_expr *prev,
                 const char *sym)
 {
+  const char *c_sym;
   const char *cxx_sym = sym;
   const char *java_sym = sym;
   struct bfd_elf_version_expr *expr = NULL;
+  enum demangling_styles curr_style;
+
+  curr_style = CURRENT_DEMANGLING_STYLE;
+  cplus_demangle_set_style (no_demangling);
+  c_sym = bfd_demangle (link_info.output_bfd, sym, DMGL_NO_OPTS);
+  if (!c_sym)
+    c_sym = sym;
+  cplus_demangle_set_style (curr_style);
 
   if (head->mask & BFD_ELF_VERSION_CXX_TYPE)
     {
-      cxx_sym = cplus_demangle (sym, DMGL_PARAMS | DMGL_ANSI);
+      cxx_sym = bfd_demangle (link_info.output_bfd, sym,
+                             DMGL_PARAMS | DMGL_ANSI);
       if (!cxx_sym)
        cxx_sym = sym;
     }
   if (head->mask & BFD_ELF_VERSION_JAVA_TYPE)
     {
-      java_sym = cplus_demangle (sym, DMGL_JAVA);
+      java_sym = bfd_demangle (link_info.output_bfd, sym, DMGL_JAVA);
       if (!java_sym)
        java_sym = sym;
     }
@@ -7413,10 +7428,10 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
        case 0:
          if (head->mask & BFD_ELF_VERSION_C_TYPE)
            {
-             e.pattern = sym;
+             e.pattern = c_sym;
              expr = (struct bfd_elf_version_expr *)
                   htab_find ((htab_t) head->htab, &e);
-             while (expr && strcmp (expr->pattern, sym) == 0)
+             while (expr && strcmp (expr->pattern, c_sym) == 0)
                if (expr->mask == BFD_ELF_VERSION_C_TYPE)
                  goto out_ret;
                else
@@ -7474,12 +7489,14 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
       else if (expr->mask == BFD_ELF_VERSION_CXX_TYPE)
        s = cxx_sym;
       else
-       s = sym;
+       s = c_sym;
       if (fnmatch (expr->pattern, s, 0) == 0)
        break;
     }
 
  out_ret:
+  if (c_sym != sym)
+    free ((char *) c_sym);
   if (cxx_sym != sym)
     free ((char *) cxx_sym);
   if (java_sym != sym)
index 3213cf7c050cc2b8c3db6a33cea8130eabba2fc1..451d0ac8f23d8b6c554668aca1781dd7a8ce0481 100644 (file)
@@ -688,7 +688,7 @@ lex_warn_invalid (char *where, char *what)
 
   if (! ISPRINT (*what))
     {
-      sprintf (buf, "\\%03o", (unsigned int) *what);
+      sprintf (buf, "\\%03o", *(unsigned char *) what);
       what = buf;
     }
 
index bfa6066b097a93b4ac63bd00219be96c6b0dd8cd..96f3bdaf3eb416283bec646c3728ed64dd541abf 100644 (file)
@@ -151,7 +151,7 @@ static bfd_boolean unattached_reloc
   (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma);
 static bfd_boolean notice
   (struct bfd_link_info *, struct bfd_link_hash_entry *,
-   bfd *, asection *, bfd_vma);
+   bfd *, asection *, bfd_vma, flagword, const char *);
 
 static struct bfd_link_callbacks link_callbacks =
 {
@@ -1483,7 +1483,9 @@ notice (struct bfd_link_info *info,
        struct bfd_link_hash_entry *h,
        bfd *abfd,
        asection *section,
-       bfd_vma value)
+       bfd_vma value,
+       flagword flags ATTRIBUTE_UNUSED,
+       const char *string ATTRIBUTE_UNUSED)
 {
   const char *name;
 
index ca7b0b855098955694e1bb42039a4ca146db2803..acd47f3f0129c0c0f5a0337145c5d7928dbd9135 100644 (file)
@@ -125,9 +125,9 @@ static const enum ld_plugin_tag tv_header_tags[] =
 static const size_t tv_header_size = ARRAY_SIZE (tv_header_tags);
 
 /* Forward references.  */
-static bfd_boolean plugin_notice (struct bfd_link_info *info,
-                                 struct bfd_link_hash_entry *h, bfd *abfd,
-                                 asection *section, bfd_vma value);
+static bfd_boolean plugin_notice (struct bfd_link_info *,
+                                 struct bfd_link_hash_entry *, bfd *,
+                                 asection *, bfd_vma, flagword, const char *);
 
 #if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
 
@@ -908,7 +908,9 @@ plugin_notice (struct bfd_link_info *info,
               struct bfd_link_hash_entry *h,
               bfd *abfd,
               asection *section,
-              bfd_vma value)
+              bfd_vma value,
+              flagword flags,
+              const char *string)
 {
   if (h != NULL)
     {
@@ -918,8 +920,33 @@ plugin_notice (struct bfd_link_info *info,
       if (is_ir_dummy_bfd (abfd))
        return TRUE;
 
+      /* Making an indirect symbol counts as a reference unless this
+        is a brand new symbol.  */
+      if (bfd_is_ind_section (section)
+         || (flags & BSF_INDIRECT) != 0)
+       {
+         if (h->type != bfd_link_hash_new)
+           {
+             struct bfd_link_hash_entry *inh;
+
+             h->non_ir_ref = TRUE;
+             inh = bfd_wrapped_link_hash_lookup (abfd, info, string, FALSE,
+                                                 FALSE, FALSE);
+             if (inh != NULL)
+               inh->non_ir_ref = TRUE;
+           }
+       }
+
+      /* Nothing to do here for warning symbols.  */
+      else if ((flags & BSF_WARNING) != 0)
+       ;
+
+      /* Nothing to do here for constructor symbols.  */
+      else if ((flags & BSF_CONSTRUCTOR) != 0)
+       ;
+
       /* If this is a ref, set non_ir_ref.  */
-      if (bfd_is_und_section (section))
+      else if (bfd_is_und_section (section))
        h->non_ir_ref = TRUE;
 
       /* Otherwise, it must be a new def.  Ensure any symbol defined
@@ -945,6 +972,7 @@ plugin_notice (struct bfd_link_info *info,
       || (info->notice_hash != NULL
          && bfd_hash_lookup (info->notice_hash, h->root.string,
                              FALSE, FALSE) != NULL))
-    return (*orig_callbacks->notice) (info, h, abfd, section, value);
+    return (*orig_callbacks->notice) (info, h,
+                                     abfd, section, value, flags, string);
   return TRUE;
 }
index 7d52cc542cf121f5803af764dc0137c17ed8a89a..2f8b09129f3de0c8f417f882d2f5d41957ef6df5 100644 (file)
@@ -106,12 +106,15 @@ SECTIONS
   .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
   {
     ${R_RDATA}
-    ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = .;}
-    ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = .;}
+    ${RELOCATING+__rt_psrelocs_start = .;}
     *(.rdata_runtime_pseudo_reloc)
-    ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
-    ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
+    ${RELOCATING+__rt_psrelocs_end = .;}
   }
+  ${RELOCATING+__rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
 
   .eh_frame ${RELOCATING+BLOCK(__section_alignment__)} :
   {
index 8fa5f052d6beca135fb95a2e785f06596b43ac98..decbd666fecce25b9ca6ac450f8da4d4b5af2c6e 100644 (file)
@@ -107,12 +107,15 @@ SECTIONS
   .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
   {
     ${R_RDATA}
-    ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = .;}
-    ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = .;}
+    ${RELOCATING+__rt_psrelocs_start = .;}
     *(.rdata_runtime_pseudo_reloc)
-    ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
-    ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
+    ${RELOCATING+__rt_psrelocs_end = .;}
   }
+  ${RELOCATING+__rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
 
   .eh_frame ${RELOCATING+BLOCK(__section_alignment__)} :
   {
index 4dfdd5785581e319afed996ed67430c72e88ea9b..1a994bc7403810b118d71efc0da382b666adef91 100644 (file)
@@ -1,3 +1,19 @@
+2011-05-24  Hans-Peter Nilsson  <hp@axis.com>
+
+       * ld-cris/tls-e-tpoffcomm1.d: Adjust for second PR12763 change,
+       setting TLS file offset.
+
+2011-05-21  Hans-Peter Nilsson  <hp@axis.com>
+
+       * ld-cris/tls-e-tpoffcomm1.d: Adjust for PR12763 change removing
+       empty program header.
+
+2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR ld/12365
+       * ld-plugin/plugin-7.d: Allow underscore in error message.
+       * ld-plugin/plugin-8.d: Likewise.
+
 2012-05-25  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline
index 69780cfd5736cbb62515d57e9af57944e96bc1f6..23d52ee06da3dc283ceda3514d831fdbf8ee7884 100644 (file)
 
 Program Header:
     LOAD off    0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13
-         filesz 0x0+a4 memsz 0x0+a4 flags r-x
-    LOAD off    0x0+a4 vaddr 0x0+820a4 paddr 0x0+820a4 align 2\*\*13
-         filesz 0x0+ memsz 0x0+ flags rw-
-     TLS off    0x0+a4 vaddr 0x0+820a4 paddr 0x0+820a4 align 2\*\*2
+         filesz 0x0+84 memsz 0x0+84 flags r-x
+     TLS off    0x0+84 vaddr 0x0+82084 paddr 0x0+82084 align 2\*\*2
          filesz 0x0+ memsz 0x0+8 flags r--
 private flags = 0:
 
 Sections:
 Idx Name          Size      VMA       LMA       File off  Algn
-  0 .text         0+10  0+80094  0+80094  0+94  2\*\*1
+  0 .text         0+10  0+80074  0+80074  0+74  2\*\*1
                   CONTENTS, ALLOC, LOAD, READONLY, CODE
-  1 .tbss         0+8  0+820a4  0+820a4  0+a4  2\*\*2
+  1 .tbss         0+8  0+82084  0+82084  0+84  2\*\*2
                   ALLOC, THREAD_LOCAL
 SYMBOL TABLE:
-0+80094 l    d  .text  0+ .text
-0+820a4 l    d  .tbss  0+ .tbss
-0+80098 l     F .text  0+c do_test
-0+80094 g       .text  0+ _start
-0+820a4 g       \*ABS\*        0+ __bss_start
+0+80074 l    d  .text  0+ .text
+0+82084 l    d  .tbss  0+ .tbss
+0+80078 l     F .text  0+c do_test
+0+80074 g       .text  0+ _start
+0+82084 g       \*ABS\*        0+ __bss_start
 0+ g       .tbss       0+4 foo
-0+820a4 g       \*ABS\*        0+ _edata
-0+820c0 g       \*ABS\*        0+ _end
+0+82084 g       \*ABS\*        0+ _edata
+0+820a0 g       \*ABS\*        0+ _end
 0+4 g       .tbss      0+4 bar
 #...
 Disassembly of section .text:
 
-00080094 <_start>:
-   80094:      41b2                    moveq 1,\$r11
+00080074 <_start>:
+   80074:      41b2                    moveq 1,\$r11
 #...
-00080098 <do_test>:
-   80098:      2f0e f8ff ffff          add.d 0xfffffff8,\$r0
-   8009e:      2f1e fcff ffff          add.d 0xfffffffc,\$r1
+00080078 <do_test>:
+   80078:      2f0e f8ff ffff          add.d 0xfffffff8,\$r0
+   8007e:      2f1e fcff ffff          add.d 0xfffffffc,\$r1
index 04f41392ca64b49199214701e144b7f14681ea18..4d0b9d7d91fe18a41fa9e6ec27d98afe0ce7cedb 100644 (file)
@@ -26,6 +26,6 @@ hook called: claim_file tmpdir/func.o \[@0/.* CLAIMED
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
 #...
 hook called: all symbols read.
-`func' referenced in section `\.text.*' of tmpdir/main.o: defined in discarded section .*
+`_?func' referenced in section `\.text.*' of tmpdir/main.o: defined in discarded section .*
 hook called: cleanup.
 #...
index 003537c94f465048858b196f29c15311512b2a92..a589f01efc6bf4325b84b74124e20dac933b8226 100644 (file)
@@ -30,6 +30,6 @@ hook called: claim_file tmpdir/text.o \[@0/.* not claimed
 hook called: all symbols read.
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
-`func' referenced in section `\.text.*' of tmpdir/main.o: defined in discarded section .*
+`_?func' referenced in section `\.text.*' of tmpdir/main.o: defined in discarded section .*
 hook called: cleanup.
 #...