complex relocations and "ld -r"
DJ Delorie
dj@redhat.com
Wed Mar 25 21:01:00 GMT 2009
If you do a relocatable link with complex relocations, elflink.c tries
to resolve the complex relocations so as to have an "absolute value"
for them. Obviously, nothing is absolute in a relocatable link, but
the attempt causes an error about referencing undefined symbols. Is
it sufficient to just skip that evaluation for relocatable links?
Index: elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.331
diff -p -U3 -r1.331 elflink.c
--- elflink.c 13 Mar 2009 11:34:42 -0000 1.331
+++ elflink.c 25 Mar 2009 20:59:44 -0000
@@ -9329,7 +9329,8 @@ elf_link_input_bfd (struct elf_final_lin
sym, *ps);
}
- if (s_type == STT_RELC || s_type == STT_SRELC)
+ if ((s_type == STT_RELC || s_type == STT_SRELC)
+ && !finfo->info->relocatable)
{
bfd_vma val;
bfd_vma dot = (rel->r_offset
More information about the Binutils
mailing list