public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Jate Sujjavanich" <jsujjavanich@syntech-fuelmaster.com>
To: <binutils@sourceware.org>
Subject: m68k-elf, flat format, reloc tables, binutils 2.16, gcc 4.1.1
Date: Fri, 03 Aug 2007 19:53:00 -0000	[thread overview]
Message-ID: <EC5EE493B6046F45A2DDEC4A828DE52E021DD15B@EXCHSRVR.syntech.org> (raw)

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.

             reply	other threads:[~2007-08-03 19:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 19:53 Jate Sujjavanich [this message]
2007-08-04  5:02 ` Mike Frysinger
2007-08-07 13:24   ` Jate Sujjavanich
2007-08-07 13:47     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EC5EE493B6046F45A2DDEC4A828DE52E021DD15B@EXCHSRVR.syntech.org \
    --to=jsujjavanich@syntech-fuelmaster.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).