[PATCH] D19995: Optimize access to global variable references in PIE mode when linker supports copy relocations for PIE

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 11:53:40 PDT 2016


Guys.
This thread seems to be massively derailed at this point.
Rafael and John seems to have a set of questions that Sri attempted to
answer, and that seemed to be going in a productive direction with other
commenting on the patch itself.

Then was a comment "This looks like a huge step in the wrong direction to
me. Copy relocations are one of the worst misfeatures of ELF. Please do not
add any new dependencies.".

I'll be blunt here.  This is generally not a good way to start a
discussion, or be constructive towards a patch..  If people have some
vision and  want to move the world forward in whatever vision they have,
that's awesome. Really.  However, if you want to get others to go along,
you need to convince others, and move the world forward yourself, not just
try to block them from doing something you don't necessarily like, unless
it's also going to cause something for LLVM itself (IE serious maintenance
burden, etc). Staring at this patch, it's about 10 lines of real change,
and seems to simply add something we already support to another mode in a
sane way.    Without any comment on copy relocs themselves, i can't see why
this is not sane way to do this.   I also see absolutely no movement
towards getting rid of it in other modes, etc.

So my suggestion would be to try to get back to making sure John, Rafael,
etc have the info they need to effectively review this patch, and not
debating the merits of copy relocations themselves *in this thread*. If
folks want to start a larger discussion where gcc, lld, gold, etc decide
they think they are sucky enough they want to avoid them, great!





On Mon, May 9, 2016 at 8:28 AM, H.J. Lu via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Mon, May 9, 2016 at 8:09 AM, Joerg Sonnenberger via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > On Mon, May 09, 2016 at 08:08:28AM -0700, H.J. Lu wrote:
> >> On Mon, May 9, 2016 at 7:53 AM, Joerg Sonnenberger via llvm-commits
> >> <llvm-commits at lists.llvm.org> wrote:
> >> > On Mon, May 09, 2016 at 07:30:20AM -0700, H.J. Lu wrote:
> >> >> > The original ABI design was static linking and dynamic linking of
> the
> >> >> > main program from exactly the same object files. Using GOT-style
> >> >> > relocations is prohibitive on all platforms without cheap
> PC-relative
> >> >> > addressing. This includes for example i386. I don't know why amd64
> >> >>
> >> >> You can use the new R_386_GOT32X relocation to access the
> >> >> GOT in executable with the base register, like
> >> >>
> >> >> movl $foo at GOT, %eax
> >> >> movl foo at GOT, %eax
> >> >>
> >> >> But not all linkers can relocate it properly.
> >> >
> >> > But that still requires the base register to be set up?
> >>
> >> The same as x86-64.
> >
> > Huh? AMD64 can address data explicitly via (%rip). i386 has no such
> > index register, so normally uses %ebx for that?
> >
>
> See my example above.  There is no base register at all.
>
> --
> H.J.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160509/a19e8c5a/attachment.html>


More information about the llvm-commits mailing list