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 Wed, Sep 29, 2010 at 02:07:16PM +0200, Bernd Schmidt wrote:
> 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.

Fair enough.  I do like the general aim of your patch, and realize
that it's often easier to make a more comprehensive change correct,
rather than messing around with minimal changes. 

So to answer your questions,

> Before I go and have a go at converting all the backend code that's
> probably broken by this - does this look like an acceptable approach?

Yes, it does look a reasonable idea to me.

> Should I remove the code in elf32_{tic6x,m32r}_fake_section and make the
> linker automatically create the necessary sections in the output?

I don't think it matters too much either way.  If you do it
automatically, and some target doesn't want it that way (eg. if
converting any input rel sections to rela) then it should be easy for
a backend_fake_sections function to undo the usual processing.

> What kind of testing is required for a patch like this?

At minimum, run the binutils testsuite on i386, powerpc, and mips.

-- 
Alan Modra
Australia Development Lab, IBM


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