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: MIPS local symbol GOT reservation w/o a reference relocation


Richard,

Thanks for responding. Bfd is being quite a learning curve for me.

I currently have things working if the ifunc entries are represented in the primary got. Ie. there were references to them in the dso/exe being linked.

There are .iplt stubs created for each ifunc that load and jump to the address in the got, whether primary as I currently have for PIC/CPIC links or igotplt for static links.

For each got (primary or not) I generate an R_MIPS_IRELATIVE relocation pointing to the got entry. The got entry has the address of the original ifunc routine and the start up routine runs that routine and replaces the original value with the result of the ifunc run.

I believe this is basically what everyone is doing. The differences seem to be in book keeping and packaging the gots.

The concern about multi-got is something I have had all along. Isn't there the issue that if the dso/exe being created was large, that references to the ifunc routine could be spread across gots? If that is the case, each of those got entries in the different gots would have to be fixed at runtime with their own IRELATIVE relocation. If I allow the current linker operation create these entries, but exchange their relocation to IRELATIVE it should just work.

Maybe the best thing to do is to have a hybrid system with both a .got and an igot.plt where the latter would be populated with ifuncs that have no references/relocations in the input objects.

Does this make sense, or is there show stopper lurking in the shadows for me here?

Jack
________________________________________
From: Richard Sandiford [rdsandiford@googlemail.com]
Sent: Tuesday, July 16, 2013 3:15 PM
To: Jack Carter
Cc: binutils@sourceware.org
Subject: Re: MIPS local symbol GOT reservation w/o a reference relocation

Jack Carter <Jack.Carter@imgtec.com> writes:
> I need to reserve and then create a local got entry for IFUNC symbols
> even when there are no reference relocations for it. This is the case
> when the dso being created has just the IFUNC definitions.

I think it'd be better to avoid that if possible and have the IPLT entries
use .igot.plt instead.  Entries in .got proper can be a bit of a scarce
resource in larger links.  Using .igot.plt would also avoid having to
deal with the interaction between these entries and multigot, which believe
me would be a good thing :-)

How are you going to deal with IRELATIVE entries in the primary
(ABI-defined) GOT?  Are there going to be a new set of dynamic tags to mark
out an IRELATIVE area, separate from the normal local and global areas?

Thanks,
Richard


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