This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: PING for PowerPC: Add msingle-pic-base option


On Mon, Nov 22, 2010 at 10:58:21PM +0100, Joakim Tjernlund wrote:
> side note, if gcc could sort the GOT so all entries needing fixups where
> in one place, one would just need a pointer to that part of the got and
> one could skip the separate fixup table.

I think your -mrelocatable -fpic patch needs some work..  .fixup is
supposed to be for non-GOT words that need relocating.  With
-mrelocatable -fPIC, the GOT is in .got2, no fixup entries are emitted
for words in .got2, and gcc takes care to only emit addresses to
.got2.  Your loader then relocates the entire .got2 section and
addresses specified in .fixup.

With -mrelocatable -fpic you ought to be able to do similarly.  ie. no
fixup entries should be emitted for words in .got, and your runtime
loader relocates the entire .got section except for the header, which
the ABI specifies as a certain number of words relative to
_GLOBAL_OFFSET_TABLE_ (but be aware that there has been an ABI
revision for -msecure-plt which uses a different GOT header).  I think
I already said this in a previous email but you seem to have ignored
that.

Note that .got is generated by the linker, not gcc.  Your comment
about gcc sorting the GOT doesn't really make sense.

-- 
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]