[PATCH] D45642: [PPC64] V2 abi: Add glink section for lazy symbol resolution.

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 06:59:16 PDT 2018


sfertile added a comment.

In https://reviews.llvm.org/D45642#1069490, @espindola wrote:

> In https://reviews.llvm.org/D45642#1069073, @sfertile wrote:
>
> > In https://reviews.llvm.org/D45642#1068980, @espindola wrote:
> >
> > > This is a plt by another name, no?
> > >
> > > Do you know why it is defined to have  another name?
> >
> >
> > I'm not sure what you mean by 'plt' here. In this abi the `.plt` section is just the array of addresses of external functions that the dynamic linker fills out at runtime.  The `.glink` section holds the lazy resolution stubs which will setup the environment for the dynamic linker to do so. Then there are also stubs for calling the external functions by loading their address out of the `.plt`. Am I right to assume by 'plt' you mean a combination of lazy resolver and the call stub?
>
>
> The question is why there is such a difference of terminology. At least of x86_64/x86/aarch64 the the array of addresses is the .got.plt section and the .plt section is what has the stubs. Just like .glink it has a special first entry. That is:
>
> pp64 v2     |     others
>  .glink          |    .plt
>  .plt             |    .got.plt


Thanks for clarifying. I knew about the .plt <--> .got.plt name mismatch for the array of function addresses,  but I had though the stubs being emitted in the .plt section for the other targets were the equivalent of the call stubs that we are currently emitting in the .plt section on PPC64 right now.

In https://reviews.llvm.org/D45642#1068980, @espindola wrote:

> Could it be implemented as a plt section and use the WritePltHeader/writePlt target hooks?


Yeah, this seems like a good  fit, as long as there is no objection to renaming GotPltSection and PltSection for EM_PPC64.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D45642





More information about the llvm-commits mailing list