[PATCH] Introduce new gold plugin option "relocation-pic"

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Apr 24 05:58:28 PDT 2014


On 24 April 2014 08:42, Alexey Volkov <avolkov.intel at gmail.com> wrote:
> On Android user doesn't have to pass -fPIC or -fPIE option.
> Clang is turning on PIC mode (not PIE) without any user input when targeting to Android.
> However when producing executable compiler has no special options (-pie) for linker.
> So linker produces executable from PIC objects without -pie option.
> So final executable is not pure PIE, it's executable formed from PIC code.
> This is what we have now on Android.
> Adding -pie option to linker could change produced code which could be surprising to user.
> Since -pie needed only to fix or workaround this bug I propose to have -pie only with LTO enabled.

But that just opens more questions:

* Why are we compiling with -fPIC when not requested?
* If the final executable is not to be PIE, why do we hit an issue
with LTO when producing a non PIE executable?

Cheers,
Rafael



More information about the llvm-commits mailing list