This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
hppa undef weak tweak
- To: binutils at sources dot redhat dot com
- Subject: hppa undef weak tweak
- From: amodra at one dot net dot au
- Date: Mon, 30 Apr 2001 23:08:17 +0930
The comment below says it all.
bfd/ChangeLog
* elf32-hppa.c (final_link_relocate): Branch to .+8 for
calls to undefined weak symbols.
Index: elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.30
diff -u -p -r1.30 elf32-hppa.c
--- elf32-hppa.c 2001/03/21 08:09:25 1.30
+++ elf32-hppa.c 2001/04/30 12:20:13
@@ -3271,10 +3271,13 @@ final_link_relocate (input_section, cont
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;