This is the mail archive of the binutils@sourceware.org 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]

Re: More rel/rela fixes for ld -r


On 09/29/2010 01:48 PM, Alan Modra wrote:
> Bernd, is there a fundamental problem with the current data
> structures? Seems to me that it ought to be possible to make things
> work without major changes to our data structures, particularly since
> we are so close to a release.

It is possible to make it work, but I chose not to send that patch since
I thought it was a bit ugly, and there were places where I wasn't
certain that what I was doing was correct.  For example, look for "PR
9827" in elflink.c.  I also don't really know how to choose the
use_rela_p flag in bfd_section_from_shdr.
In any case, we must ensure that there is a well-defined order, i.e. if
both REL and RELA sections exist, then rel_hdr must always contain
(let's say) RELA.  From there on it's a relatively small conceptual step
to separate the two more clearly, and doing so simplifies the code in a
few places.

I'm attaching the variant I have in our internal svn.  I can either try
to adapt this to mainline binutils, or I can work on finishing up the
other one.  I don't mind if it goes in after the next release; I think
we can carry it locally for a while.

> I agree that the current scheme is
> messy, and a quick look over the code reveals places that assume only
> one of rel or rela relocs is used per section, not both.

Yes.  That is also true, and I didn't really try to do anything about
it.  The patch below was sufficient to enable us to link a Linux kernel
compiled with TI's compiler.


Bernd

Attachment: other-relrela.diff
Description: Text document


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