From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Wed, 21 Oct 2015 20:09:28 +0800 Subject: [U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section In-Reply-To: <20151021134227.55a71b8c@lilith> References: <1445320795-2235-1-git-send-email-Peng.Fan@freescale.com> <20151020090532.48426615@lilith> <20151020072039.GA26880@shlinux2> <20151020093251.468ebaa0@lilith> <20151020074127.GA31531@shlinux2> <20151020145910.5e40f8cf@lilith> <20151021094216.GA29761@shlinux2> <20151021134227.55a71b8c@lilith> Message-ID: <20151021120925.GA3299@shlinux2> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >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. --