This is the mail archive of the
mailing list for the binutils project.
Re: [GOLD] relaxation query
The layout code knows how to rollback some states it need to restart
layout. It keeps checkpoints for output sections and segment. If you
do not change to sections but just change their sizes, you don't need
to do anything special. In the ARM backend, I need to group input
section in to groups to general stubs. The grouping is done in the
first relaxation pass, so I have to tell the checkpoint-rollback
machinery that I am changing the input section types for some input
section. I could change all the input sections into ARM specific
input sections at the beginning to avoid changing sections in
relaxation but that would be a waste of memory and would make some
I honestly agree with you that the existing code is not pretty. If
you can think of something better, let's discuss and see if and how we
can improve relaxation support in gold.
On Mon, Nov 26, 2012 at 7:27 PM, Alan Modra <firstname.lastname@example.org> wrote:
> On Mon, Nov 26, 2012 at 02:51:54PM -0800, Doug Kwan (éæå) wrote:
>> Relaxation was retrofitted into layout when I did the ARM port.
>> Basically I assume that I have all the sections but I can repeatedly
>> lay them out until the layout is stabilized. You may be able to add a
>> new section but you have to be very careful that the layout data
>> structure is consistent and the new sections are still there if layout
>> fails and relaxation rolls back the layout and retries.
> So how much of that checkpointing and rollback is really needed? What
> more do you need than resetting some flags to avoid assertions?
> I think it rather horrible that you took the approach of saving and
> restoring everything in an Output_segment and likely the largest
> vector in Output_section, input_sections_. It means we effectively go
> back to the old GNU ld way of creating all sections you might need
> well before relaxation. Either that or go to the trouble of
> updating the saved state, which is messy.
> Alan Modra
> Australia Development Lab, IBM