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 02:32:20:
>
> On Tue, Nov 23, 2010 at 01:25:41AM +0100, Joakim Tjernlund wrote:
> > It is impossible (as is today) to tell which ptr's in the GOT needs
> > fixup and those which don't.
>
> This is where we disagree.  I think all of .got should be relocated,
> except for the header.  If I'm correct, then fixups for .got are
> redundant and therefore just a waste of space.

I we have an misunderstanding here. The got itself does not need fixups but
some of the data it points to needs fixup. Today you construct a separate
table with fixup pointers but I think this table is really redundant.
If you could somehow known which got ptrs points to data needing fixup you
could do the fixup by following the got ptr.

Suppose you could organise the got table so that first you all
got ptrs that don't need fixups and then all the ones that do need fixups:
.got {
/* No fixups for these */
  p1
  p2
  p3
....
_FIXUP_START = .
/* These needs fixup */
  pf1
  pf2
...
}

Now you relocate the whole .got as usual, then go back and
run fixup from _FIXUP_START and you are done.

The problem is how to make the linker do this for us.
I cannot think of a way really, perhaps one could mark all
syms needing fixups with a different type such as
 .type xxxx, @gnu_indirect_function
?

    Jocke


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