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


Alan Modra <amodra@gmail.com> wrote on 2010/11/23 00:46:57:
>
> 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.

No need for more work. It would just be an addon to the existing -mrelocatable, my
patch doesn't change that. It was just an idea to improve -mrelocatable in
general. My understanding of fixup is a bit limited but here goes:
Each fixup worthy ptr generates both an GOT entry and a fixup entry.
It is impossible (as is today) to tell which ptr's in the GOT needs
fixup and those which don't. Therefore an separate fixup table is created
which is basically an copy of the GOT ptr's needing fixup's

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

hmm, how does -msecure-plt header differ. Does it only miss the brlr
insn at _GLOBAL_OFFSET_TABLE_-4?
Don't think it will be a problem though. Secure plt isn't something
we want in a boot loader, it is bigger.

> I already said this in a previous email but you seem to have ignored
> that.

Hmm, I never understood that. Need to go back an reread then.

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

yes, noticed that. The linker won't allow me to do my own .got sections either.


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