[U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section

Peng Fan b51431 at freescale.com
Wed Oct 21 14:09:28 CEST 2015


Hello Albert,

On Wed, Oct 21, 2015 at 01:42:27PM +0200, Albert ARIBAUD wrote:
>Hello Peng,
>
>On Wed, 21 Oct 2015 17:42:20 +0800, Peng Fan <b51431 at freescale.com>
>wrote:
>> Hello Albert,
>
>> I do not know how to generate non-relocatable code only for the secure text.
>> Since -mword-relocations and -pie are global flags, I do not know how to disable
>> mword-relocations when compiling PSCI and other secure text.
>
>Actually, I haven't even found a compiler or gcc option to entirely
>remove relocations altogether.
>
>> Is this ok for you?
>> 
>> diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
>> index 65986e8..fb2128a 100644
>> --- a/arch/arm/cpu/u-boot.lds
>> +++ b/arch/arm/cpu/u-boot.lds
>> @@ -14,6 +14,7 @@ OUTPUT_ARCH(arm)
>> ENTRY(_start)
>> SECTIONS
>> {
>> +       /DISCARD/ : { *(.rel._secure*) }
>>         . = 0x00000000;
>>    
>>         . = ALIGN(4);
>
>Functionally, it works -- I've just checked it by comparing u-boot.map
>files of a mx7dsabresd build with and without the DISCARD. Not a single
>symbol from the text and data section gets changed.
>
>The only missing thing left is a comment before the DISCARD line,
>explaining both why .rel._secure* input sections have to be discarded,
>and also explaining why this is done it right at the start of the output
>sections.

Ok. Will add the comments in V3.

Regards,
Peng.

>
>Thanks for your patience. :)
>
>> Regards,
>> Peng.
>
>Amicalement,
>-- 
>Albert.

-- 


More information about the U-Boot mailing list