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

Alexey Volkov avolkov.intel at gmail.com
Tue Feb 18 07:45:02 PST 2014


Hi Rafael,

Before clang parses -Wl options there is some logic based on PIE, e.g. crt
object name selection.
One possible solution is to move -Wl options before crt objects.
But I am not sure if such reordering of linker arguments is possible.
Another solution is to parse -Wl option value directly before it is passed
to CmdArgs.
Do you have any other ideas?

--Alexey


2014-02-14 20:54 GMT+04:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:

> On 14 February 2014 11:45, Alexey Volkov <avolkov.intel at gmail.com> wrote:
> >
> >   Unfortunately my last patch cannot work with -Wl compiler option.
> >   E.g. passing -Wl,-shared will not set OPT_shared variable and so
> -shared and -pie both passed to linker.
> >   Linker will complain about incompatible options.
> >   I am not sure if parsing -Wl option value for shared, static, etc is
> acceptable here.
> >   In my first patch addition of new gold plugin option does not have
> such problems.
>
> It has stranger ones. The gold plugin and the linker should be in
> agreement as to the type of output they are working to produce.
>
> Clang has to parse -Wl options, so maybe the logic in the current
> patch should be moved down a bit and work directly on the flags the
> driver already has for passing to the linker?
>
> Cheers,
> Rafael
>



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


More information about the llvm-commits mailing list