From db20fd76547e0c6e7f73969bbeec15e3d83a182e Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 30 Apr 2001 13:34:41 +0000 Subject: [PATCH] * elf32-hppa.c (final_link_relocate): Branch to .+8 for calls to undefined weak symbols. --- bfd/ChangeLog | 5 +++++ bfd/elf32-hppa.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ab373eaf453..eebb8fa1905 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2001-04-30 Alan Modra + + * elf32-hppa.c (final_link_relocate): Branch to .+8 for + calls to undefined weak symbols. + 2001-04-30 Andreas Jaeger , Andreas Schwab * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 06b60200dcd..fdcb3b4ff7e 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -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; -- 2.30.2