This is the mail archive of the binutils@sources.redhat.com 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: RFA: MIPS's _gp symbol and the new orphan-placement code


Alan Modra <amodra@bigpond.net.au> writes:
> On Sun, Nov 07, 2004 at 09:06:04AM +0000, Richard Sandiford wrote:
>> The new orphan placement code puts this .reginfo section right before
>> .got.  This should be fine in theory, but unfortunately, the linker
>> scripts set up _gp using:
>> 
>>   _gp = ALIGN(16) + 0x7ff0;
>>   .got            : { *(.got.plt) *(.got) }
>
> Sorry about the breakage.

Not at all...

> It's quite difficult to decide where an orphan section can be
> inserted.

...I totally agree, and like I said in my original post, I've no
complaint against your change at all.  Setting _gp outside .got
was always a flaky construct.

All the follow-ups were about changing the placement heuristic, but I
don't think any of the suggestions would make existing MIPS scripts work
out of the box.  Any tweak which _does_ make them work could well break
other scripts.

I think we're going to have change the MIPS scripts whatever happens,
and if we're going to do that, we might as well try to make them more
robust.  Does anyone have any comments about the new _gp assignment in
my patch?  Is it better, or could it lead to other problems?  Do you
prefer the idea of introducing new orphan placement hints and keeping
the assignment as-is?

FWIW:

Alan Modra <amodra@bigpond.net.au> writes:
> On Sun, Nov 07, 2004 at 08:16:36PM -0500, Daniel Jacobowitz wrote:
>> On Mon, Nov 08, 2004 at 09:18:25AM +1030, Alan Modra wrote:
>> > We really need some sort of syntactic
>> > hint that ties the assignment to the section.  One such hint is to
>> > write:
>> > 
>> >   . = .;
>> >   _gp = ALIGN(16) + 0x7ff0;
>> >   .got            : { *(.got.plt) *(.got) }
>> 
>> Or maybe require/support syntactic hints saying where orphan sections
>> can be inserted?
>
> Yes, extra braces would work, or even taking note of blank lines.  The
> latter has the advantage that many existing scripts would "just work".

Given that scripts aren't white-space sensitive right now, it might be
a bit confusing to give special meaning to blank lines.  Also (from a
selfish MIPS standpoint) it wouldn't be enough to make the IRIX case
work since the default script has no blank lines. ;)

Perhaps one possibility would be: don't insert orphan sections after any
assignment with a positive offset from something based on ".".  But I
don't like that much. ;)  Some unequivocal syntax would be better...

Richard


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