[PATCH] D19996: New clang option -mpiecopyrelocs to indicate support for linker copy relocations when linking as PIE

Sriraman Tallam via cfe-commits cfe-commits at lists.llvm.org
Thu May 5 14:34:55 PDT 2016


On Thu, May 5, 2016 at 2:31 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> Is there a gcc option or they just assume they are targeting the
> linker that was around when gcc was built?

It is done at configure time, the linker is checked for copy
relocations support.  I recently saw a request to replace this with a
flag like -mpiecopyrelocs.  I chatted off-line with Reid about this
and a flag was suggested.

>
>
>> +  if (Args.hasFlag(options::OPT_mpiecopyrelocs, options::OPT_mno_piecopyrelocs,
>> +                   false)) {
>> +    CmdArgs.push_back("-piecopyrelocs");
>> +  }
>
> you don't need the {}
>
>> +def piecopyrelocs : Flag<["-"], "piecopyrelocs">,
>> +  HelpText<"Linker copy relocations support when linking as PIE">;
>
> I think you are missing a verb: Linker copy relocations *are* supported.
>
> But how about just "Position independent executables can have copy relocations"?
>
> Cheers,
> Rafael


More information about the cfe-commits mailing list