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

Alexey Volkov avolkov.intel at gmail.com
Tue Feb 11 07:46:44 PST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140211/dc47f480/attachment.html>


More information about the llvm-commits mailing list