[PATCH, rs6000] Pass --secure-plt to the linker

Szabolcs Nagy szabolcs.nagy@arm.com
Mon Oct 19 13:23:00 GMT 2015


On 19/10/15 12:12, Alan Modra wrote:
> On Thu, Oct 15, 2015 at 06:50:50PM +0100, Szabolcs Nagy wrote:
>> A powerpc toolchain built with (or without) --enable-secureplt
>> currently creates a binary that uses bss plt if
>>
>> (1) any of the linked PIC objects have bss plt relocs
>> (2) or all the linked objects are non-PIC or have no relocs,
>>
>> because this is the binutils linker behaviour.
>>
>> This patch passes --secure-plt to the linker which makes the linker
>> warn in case (1) and produce a binary with secure plt in case (2).
>
> The idea is OK I think, but
>
>> @@ -574,6 +577,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
>>   %{R*} \
>>   %(link_shlib) \
>>   %{!T*: %(link_start) } \
>> +%{!static: %(link_secure_plt_default)} \
>>   %(link_os)"
>
> this change needs to be conditional on !mbss-plt too.
>

OK, will change that.

if -msecure-plt and -mbss-plt are supposed to affect
linking too (not just code gen) then shall i add
%{msecure-plt: --secure-plt} too?



More information about the Gcc-patches mailing list