]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2001-02-20 Andreas Jaeger <aj@suse.de>
authorAndreas Jaeger <aj@suse.de>
Tue, 20 Feb 2001 08:02:07 +0000 (08:02 +0000)
committerAndreas Jaeger <aj@suse.de>
Tue, 20 Feb 2001 08:02:07 +0000 (08:02 +0000)
* elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make
PLT entries that could serve as a definition for a weak symbol.

bfd/ChangeLog
bfd/elf64-x86-64.c

index 74b92a105a904ed8348ba473d9c24f95102aa221..b45c1ec5429e13d70940f8c8b577e1a67cdddbcb 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-20  Andreas Jaeger  <aj@suse.de>
+
+       * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make
+       PLT entries that could serve as a definition for a weak symbol.
+
 2001-02-18  David O'Brien  <obrien@FreeBSD>
 
        * configure.in: Recognize FreeBSD/arm, FreeBSD/PowerPC, and treat
@@ -14,7 +19,7 @@
        checking.
        (pe_bfd_object_p): Rewrite with external_PEI_DOS_hdr and
        external_PEI_IMAGE_hdr.
-       
+
 2001-02-14  Bo Thorsen  <bo@suse.de>
 
         * elf64-x86-64.c: Small formatting fixes and rearrangements of code.
index 9e10c917f0d50542046371d7463685d4053003f7..3845cc183ab1b5476749759b4eb7ddd510d501af 100644 (file)
@@ -1656,6 +1656,13 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
          /* Mark the symbol as undefined, rather than as defined in
             the .plt section.  Leave the value alone.  */
          sym->st_shndx = SHN_UNDEF;
+         /* If the symbol is weak, we do need to clear the value.
+            Otherwise, the PLT entry would provide a definition for
+            the symbol even if the symbol wasn't defined anywhere,
+            and so the symbol would never be NULL.  */
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+             == 0)
+           sym->st_value = 0;
        }
     }