This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Possible sparc64 relocation bug
- From: "David O'Brien" <obrien at FreeBSD dot org>
- To: GNU Binutils mailing list <binutils at sources dot redhat dot com>
- Date: Mon, 4 Nov 2002 19:23:05 -0800
- Subject: Possible sparc64 relocation bug
- Organization: The NUXI BSD Group
- Reply-to: obrien at FreeBSD dot org
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. */