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

Alexey Volkov avolkov.intel at gmail.com
Tue Feb 11 08:43:02 PST 2014


Sorry, about -static I wasn't right: there are no problems on Android with
them since there are no relocations in static executable.
The original problem is that COPY relocations are not supported on Android
so PIC is used by default.
Without new gold plugin option the only way I see is to pass -pie to linker
only when building dynamic executable, is it right?


2014-02-11 19:46 GMT+04:00 Alexey Volkov <avolkov.intel at gmail.com>:

> Clang should pass some option to linker (e.g. -pie) when compiling for
> Android.
> But in case of static executable (-static linker option) I see no way to
> pass PIC/PIE mode through linker since static and pie are incompatible
> linker options.
>
> Best regards,
> Alexey
>
>
> 2014-02-11 0:33 GMT+04:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
>
> On 10 February 2014 10:22, Alexey Volkov <avolkov.intel at gmail.com> wrote:
>> >
>> >   Ping
>>
>> Sorry. I missed this the first time.
>>
>> Why do you need a command line option? Why can't the linker tell you
>> that it needs a PIC output? We already have
>>
>>       case LDPT_LINKER_OUTPUT:
>>         switch (tv->tv_u.tv_val) {
>>           case LDPO_REL:  // .o
>>           case LDPO_DYN:  // .so
>>           // FIXME: Replace 3 with LDPO_PIE once that is in a released
>> binutils.
>>           case 3: // position independent executable
>>             output_type = LTO_CODEGEN_PIC_MODEL_DYNAMIC;
>>
>> Cheers,
>> Rafael
>>
>
>
>
> --
> Alexey Volkov
> Intel Corporation
>



-- 
Alexey Volkov
Intel Corporation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140211/9c16e36c/attachment.html>


More information about the llvm-commits mailing list