This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
m68k-elf, flat format, reloc tables, binutils 2.16, gcc 4.1.1
- From: "Jate Sujjavanich" <jsujjavanich at syntech-fuelmaster dot com>
- To: <binutils at sourceware dot org>
- Date: Fri, 3 Aug 2007 15:58:00 -0400
- Subject: m68k-elf, flat format, reloc tables, binutils 2.16, gcc 4.1.1
I am looking for more information on how the linker generates reloc
tables. I am using binutils 2.16 and am trying to get shared libraries
working for the Coldfire architecture under uClinux. The first
dependency (shared library uClibc) fails to load because of invalid
values in the relocation table.
The first 123 values in the table resolve correctly into a table of
strings. For these, the output from readelf -r matches the values in the
binary.
Data + GOT size is 0x30dc0.
Offset Info Type Sym.Value Sym. Name + Addend
00001e50 0007b301 R_68K_32 000010fc _string_syserrmsgs + 0
Reloc table
34c90: 01032c10 (which is &.data + size(GOT) + Offset)
32c10: 01031ebc (which is &.data + size(GOT) + Sym.Value + Addend)
First question: are these forumulas correct for calculating these
pointer addresses?
The first reloc table entry not in the string section does not follow
this formula.
Offset Info Type Sym.Value Sym. Name + Addend
0000213e 00000301 R_68K_32 00000000 .data + 2f9f
Reloc table
34e7c: 01032efe
32efe: 01033b7c (should be 01333d5f or 0x30dc0 + 0 + 0x2f9f?)
This is actually off by 0x1e3 which is the size of the GOT+3.
Table entry number 219 is totally wrong. It is 0x00000001, which tells
the flat loader that it's a reference to shared library 0 within shared
library 1. This is incorrect.
Most of the readelf relocation table entries are offsets of .data,
.text, and .bss.
Any descriptions and recommendations are greatly appreciated.
Jate Sujjavanich
Embedded Systems Engineer
Syn-tech Systems, Inc.