]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf32-hppa.c (final_link_relocate): Branch to .+8 for
authorAlan Modra <amodra@gmail.com>
Mon, 30 Apr 2001 13:36:04 +0000 (13:36 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 30 Apr 2001 13:36:04 +0000 (13:36 +0000)
calls to undefined weak symbols.

bfd/ChangeLog
bfd/elf32-hppa.c

index 32c2eaeb9ba7ccfaae90533f986786e4b20433c8..be275cf74d88f5cc685250f92fd3de3e93ad3739 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-30  Alan Modra  <amodra@one.net.au>
+
+       * elf32-hppa.c (final_link_relocate): Branch to .+8 for
+       calls to undefined weak symbols.
+
 2001-04-19  Andreas Jaeger  <aj@suse.de>
 
        * elf64-x86-64.c (elf64_x86_64_plt0_entry): Fix instructions.
index 06b60200dcd674f60549601407880013bb0cee7f..fdcb3b4ff7e004833c7c488581d95366dcf71ba3 100644 (file)
@@ -3271,10 +3271,13 @@ final_link_relocate (input_section, contents, rel, value, hplink, sym_sec, h)
          else if (sym_sec == NULL && h != NULL
                   && h->elf.root.type == bfd_link_hash_undefweak)
            {
-             /* It's OK if undefined weak.  Make undefined weak
-                branches go nowhere.  */
+             /* It's OK if undefined weak.  Calls to undefined weak
+                symbols behave as if the "called" function
+                immediately returns.  We can thus call to a weak
+                function without first checking whether the function
+                is defined.  */
              value = location;
-             addend = 0;
+             addend = 8;
            }
          else
            return bfd_reloc_notsupported;