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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Feb 18 07:55:13 PST 2014


On 18 February 2014 10:45, Alexey Volkov <avolkov.intel at gmail.com> wrote:
> 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?

Unfortunately no. It does raise the question of when -Wl should be
interpreted by the clang driver. If we parse it to decide if we are
producing a shared object and don't need to also pass a PIE option, we
should probably also parse it for deciding which crt object to use.

On the other hand, if we don't parse it when deciding which crt object
to use, then the correct behavior is probably to not parse the -Wl
options at all and expect the user to use the driver equivalent ones
(-shared for example). This would match gcc's behavior, no?

Cheers,
Rafael



More information about the llvm-commits mailing list