public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section
Date: Wed, 21 Oct 2015 13:42:27 +0200	[thread overview]
Message-ID: <20151021134227.55a71b8c@lilith> (raw)
In-Reply-To: <20151021094216.GA29761@shlinux2>

Hello Peng,

On Wed, 21 Oct 2015 17:42:20 +0800, Peng Fan <b51431@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.

Thanks for your patience. :)

> Regards,
> Peng.

Amicalement,
-- 
Albert.

  reply	other threads:[~2015-10-21 11:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20  5:59 [U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section Peng Fan
2015-10-20  5:59 ` [U-Boot] [PATCH V2 2/3] mx7: psci: add basic psci support Peng Fan
2015-10-20 10:50   ` Fabio Estevam
2015-10-20 14:05   ` Li Frank
2015-10-20 14:25     ` Albert ARIBAUD
2015-10-20 14:29       ` Li Frank
     [not found]         ` <20151020165526.1ae0c332@lilith>
     [not found]           ` <BY2PR0301MB163850B2C1169D80C249AB2782390@BY2PR0301MB1638.namprd03.prod.outlook.com>
2015-10-20 21:04             ` Albert ARIBAUD
2015-10-20 21:12               ` Li Frank
2015-10-20  5:59 ` [U-Boot] [PATCH V2 3/3] imx: mx7: default enable non-secure mode Peng Fan
2015-10-20  7:05 ` [U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section Albert ARIBAUD
2015-10-20  7:20   ` Peng Fan
2015-10-20  7:32     ` Albert ARIBAUD
2015-10-20  7:41       ` Peng Fan
2015-10-20 12:59         ` Albert ARIBAUD
2015-10-21  9:42           ` Peng Fan
2015-10-21 11:42             ` Albert ARIBAUD [this message]
2015-10-21 12:09               ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151021134227.55a71b8c@lilith \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox