[committed, PATCH] x86: Properly check building shared library

Cary Coutant ccoutant@gmail.com
Wed Feb 14 06:20:00 GMT 2018


> I'm curious as to why this is necessary, in case other targets need
> the same treatment.  Normally a PIE is built from position independent
> code, and thus addresses of functions are loaded from the GOT.  That
> means there is no need to use any tricks to avoid dynamic text relocs.

I, for one, think it is not necessary, as anywhere it's valid to treat
the PC32 reloc as if it were a PLT32 reloc, the compiler or assembler
could (and should) have simply used a PLT32 reloc. I think it's
dangerous to simply assume that it's always valid to redirect any
arbitrary PC32 reloc to a PLT entry. There's a reason these are two
separate relocations.

I also think this is likely to be unique to the x86 architecture.

-cary



More information about the Binutils mailing list