Possible sparc64 relocation bug
David O'Brien
obrien@FreeBSD.org
Mon Nov 4 19:24:00 GMT 2002
We're finding on FreeBSD/sparc64 that binutils generates invalid Elf_Rela
records for certain relocations, they don't contain the values that the
ABI says they should. It seems to only affect things with text
relocations, kernel modules and c++ libraries. If one compiles libstdc++
w/o -g for instance. (by default libstdc++ is compiled -g, and the text
relocations don't occur)
Thoughts on the below patch?
Index: elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.60
diff -u -r1.60 elf64-sparc.c
--- elf64-sparc.c 24 Sep 2002 15:54:22 -0000 1.60
+++ elf64-sparc.c 5 Nov 2002 03:18:34 -0000
@@ -2197,6 +2197,7 @@
osec = sec->output_section;
indx = elf_section_data (osec)->dynindx;
+ relocation -= osec->vma;
/* FIXME: we really should be able to link non-pic
shared libraries. */
More information about the Binutils
mailing list