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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Feb 20 14:36:15 PST 2014


On 20 February 2014 09:00, Alexey Volkov <avolkov.intel at gmail.com> wrote:
> On Android there is a bit unusual situation when compiler makes PIC code but
> doesn't pass -pie to linker.
> This is what LLVM and gcc both do without -flto.
> With -flto GCC still produces PIC code but not LLVM.
> The reason is that GCC passes -fpic to compiler invocation from plugin using
> temporary file with options for compiler.
> I tried to implement similar solution with my first patch introducing gold
> plugin option.

OK, so it does seem there is a bug in the android linker, right? It is
produce a PIE executable but not informing the plugin of that unless
it is given the -pie option.

> Anyway addition of -pie would produce correct code for Android.
> As I understand my last patch with -pie is ok except change with sanitizer?

And the more philosophical issue of  "should we parse -Wl?".

Cheers,
Rafael



More information about the llvm-commits mailing list