From: David Miller <davem@davemloft.net>
To: richm@oldelvet.org.uk
Cc: 609371@bugs.debian.org, ben@decadent.org.uk,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
rostedt@goodmis.org, fweisbec@gmail.com, mingo@redhat.com,
Jesper.Nilsson@axis.com, jeffm@suse.com
Subject: Re: R_SPARC_13
Date: Tue, 18 Jan 2011 20:12:27 -0800 (PST) [thread overview]
Message-ID: <20110118.201227.116359736.davem@davemloft.net> (raw)
In-Reply-To: <20110118.130027.28804895.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Tue, 18 Jan 2011 13:00:27 -0800 (PST)
> I'll look into fixing binutils so that it properly reports the
> correct R_SPARC_OLO10 relocation in dumps. There really is no
> excuse for what it's currently doing. In fact, I think this
> quirk has sent me on wild goose chases in the past.
Ok, after looking into it I got reminded why this is still behaving
the way that it is.
The problem is that R_SPARC_OLO10 relocations have 2 addends instead
of one. But the BFD libraries generic "arelent" structure only has
room to store one of the addends.
So the 64-bit ELF Sparc backend emits R_SPARC_OLO10 as R_SPARC_LO10 +
R_SPARC_13 internally solely for the purpose of being able to store
the second addend away somewhere.
This all happens in the relocation table slurping code in
bfd/elf64-sparc.c, and this is what objdump uses to get it's info.
BTW, readelf prints the relocations of this type properly and
without this weird translation.
I considered several avenues to make this translation scheme
unnecessary.
Making arelent larger in order to store the second addend would be
frowned upon since only 64-bit sparc needs it but the space cost would
be eaten by everyone.
The other idea was to somehow make the existing addend field smaller
on 64-bit so we could add the second addend storage to arelent at
zero cost. But after studying the binutils code I'm pretty sure
that the addend field really does need to be a full 64-bits.
This really needs to be fixed for another reason, which is that this
scheme requires allocating twice as much memory to store relocations
internally. This is because we have to size the internal relocation
table in BFD before we scan the table and know if any R_SPARC_OLO10
compound relocs actually exist and if so how many.
An even worse case is MIPS 64-bit, where every relocation expands to
3 (?!?!) internal BFD relocation objects.
Anyways just a detailed brain dump on what the situation is with this,
I'll see if I can come up with other ideas.
next prev parent reply other threads:[~2011-01-19 4:11 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110113.155700.102679408.davem@davemloft.net>
[not found] ` <4D302B2F.7030108@oldelvet.org.uk>
[not found] ` <4D3074FE.3030707@oldelvet.org.uk>
2011-01-16 5:17 ` Bug#609371: linux-image-2.6.37-trunk-sparc64: module scsi_mod: Unknown relocation: 36 David Miller
2011-01-16 14:17 ` Richard Mortimer
2011-01-16 19:39 ` David Miller
2011-01-17 14:11 ` Steven Rostedt
2011-01-17 14:37 ` Bastian Blank
2011-01-17 19:35 ` Mathieu Desnoyers
2011-01-18 6:36 ` David Miller
2011-01-18 5:34 ` David Miller
2011-01-18 6:00 ` David Miller
2011-01-18 6:08 ` David Miller
2011-01-18 16:46 ` Mathieu Desnoyers
2011-01-18 17:33 ` Steven Rostedt
2011-01-18 18:16 ` Steven Rostedt
2011-01-18 18:26 ` Steven Rostedt
2011-01-18 20:13 ` Mathieu Desnoyers
2011-01-18 20:22 ` Steven Rostedt
2011-01-19 5:08 ` Mathieu Desnoyers
2011-01-19 5:16 ` David Miller
2011-01-19 15:10 ` Mathieu Desnoyers
2011-01-19 16:14 ` Sam Ravnborg
2011-01-19 16:18 ` Mathieu Desnoyers
2011-01-19 6:32 ` David Miller
2011-01-19 7:20 ` David Miller
2011-01-19 15:33 ` Mathieu Desnoyers
2011-01-19 21:40 ` David Miller
2011-01-19 22:00 ` Steven Rostedt
2011-01-19 22:09 ` David Miller
2011-01-19 22:21 ` Mathieu Desnoyers
2011-01-19 22:23 ` David Miller
2011-01-19 22:32 ` Sam Ravnborg
2011-01-19 22:34 ` Mathieu Desnoyers
2011-01-19 22:13 ` Mathieu Desnoyers
2011-01-19 22:21 ` David Miller
2011-01-19 22:33 ` Mathieu Desnoyers
2011-01-20 0:41 ` David Miller
2011-01-21 0:04 ` Mathieu Desnoyers
2011-01-21 18:06 ` Richard Mortimer
2011-01-21 18:52 ` Mathieu Desnoyers
2011-01-21 19:15 ` Mathieu Desnoyers
2011-01-21 20:14 ` Richard Mortimer
2011-01-21 20:40 ` Mathieu Desnoyers
2011-01-21 22:50 ` Richard Mortimer
2011-01-22 18:42 ` Richard Mortimer
2011-01-22 18:53 ` Mathieu Desnoyers
2011-01-19 15:46 ` Steven Rostedt
2011-01-19 16:15 ` Mathieu Desnoyers
2011-01-19 18:13 ` Steven Rostedt
2011-01-19 18:20 ` Mathieu Desnoyers
2011-01-19 21:44 ` David Miller
2011-01-19 22:15 ` Mathieu Desnoyers
2011-01-19 22:22 ` David Miller
2011-01-19 15:11 ` Mathieu Desnoyers
2011-01-19 15:27 ` Richard Mortimer
2011-01-17 6:07 ` David Miller
2011-01-17 9:05 ` Jesper Nilsson
2011-02-01 5:11 ` David Miller
2011-02-01 10:03 ` Jesper Nilsson
2011-01-17 10:22 ` Richard Mortimer
2011-01-17 14:15 ` Steven Rostedt
2011-01-18 6:35 ` David Miller
2011-01-18 17:30 ` Steven Rostedt
2011-01-17 19:46 ` R_SPARC_13 (Re: Bug#609371: linux-image-2.6.37-trunk-sparc64: module scsi_mod: Unknown relocation: 36) Richard Mortimer
2011-01-17 21:02 ` R_SPARC_13 David Miller
2011-01-17 23:34 ` R_SPARC_13 Richard Mortimer
2011-01-18 0:18 ` R_SPARC_13 David Miller
2011-01-18 0:37 ` R_SPARC_13 David Miller
2011-01-18 1:28 ` R_SPARC_13 Richard Mortimer
2011-01-18 6:50 ` R_SPARC_13 David Miller
2011-01-18 10:52 ` R_SPARC_13 Richard Mortimer
2011-01-18 13:23 ` R_SPARC_13 Richard Mortimer
2011-01-18 21:00 ` R_SPARC_13 David Miller
2011-01-19 4:12 ` David Miller [this message]
2011-01-17 14:39 ` Bug#609371: linux-image-2.6.37-trunk-sparc64: module scsi_mod: Unknown relocation: 36 Bernhard R. Link
2011-01-18 5:24 ` David Miller
2011-01-18 9:26 ` Jesper Nilsson
2011-01-18 6:27 ` David Miller
2011-01-18 17:05 ` Steven Rostedt
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=20110118.201227.116359736.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=609371@bugs.debian.org \
--cc=Jesper.Nilsson@axis.com \
--cc=ben@decadent.org.uk \
--cc=fweisbec@gmail.com \
--cc=jeffm@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richm@oldelvet.org.uk \
--cc=rostedt@goodmis.org \
--cc=sparclinux@vger.kernel.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
all inboxes | Powered by JetHome®