This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Possible sparc64 relocation bug


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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]