public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] 85xx: Ensure BSS segment doesn't start at address 0x0
Date: Tue, 06 Oct 2009 10:54:09 +0200	[thread overview]
Message-ID: <20091006085409.40E994C021@gemini.denx.de> (raw)
In-Reply-To: <1254783670-21301-3-git-send-email-ptyser@xes-inc.com>

Dear Peter Tyser,

In message <1254783670-21301-3-git-send-email-ptyser@xes-inc.com> you wrote:
> When U-Boot is relocated from flash to RAM pointers are modified
> accordingly.  However, pointers initialzed with NULL values should not
> be modified so that they maintain their intended NULL value.  The
> address of the BSS segment must be modified during relocation which
> means that it must not have a NULL value.
> 
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
>  cpu/mpc85xx/u-boot.lds.S |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/cpu/mpc85xx/u-boot.lds.S b/cpu/mpc85xx/u-boot.lds.S
> index a347cd1..ef3de66 100644
> --- a/cpu/mpc85xx/u-boot.lds.S
> +++ b/cpu/mpc85xx/u-boot.lds.S
> @@ -131,6 +131,14 @@ SECTIONS
>  
>    . = RESET_VECTOR_ADDRESS + 0x4;
>  
> +  /*
> +   * Make sure that the bss segment doesn't start at 0x0, otherwise its
> +   * address won't be updated during relocation fixups
> +   */
> +#if !((RESET_VECTOR_ADDRESS + 0x4) & 0xffffffff)

This seems to be a pretty complicated way of writing

	#if (RESET_VECTOR_ADDRESS == 0xFFFFFFFC)

?

> +  . |= 0x10;

I'm not sure if all this is always doing what we want, or if it's
always working the same way. When building on 32 bit machines, dot
will wrap around for "0xFFFFFFFC + 4" and result in 0; ". |= 0x10"
makes it 0x10 then.

When built using a 64 bit host, 0xFFFFFFFC + 4 = 0x100000000, and the
OR makes it 0x100000010. But here this OR was not needed.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"My name is Linus Torvalds, you messed with my kernel, prepare to die"
                                                  - Linus Torvalds in
      <Pine.LNX.3.91.960426110644.24860I-100000@linux.cs.Helsinki.FI>

  reply	other threads:[~2009-10-06  8:54 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 23:01 [U-Boot] [PATCH 0/2] Make sure 85xx bss doesn't start at 0x0 Peter Tyser
2009-10-05 23:01 ` [U-Boot] [PATCH 1/2] 85xx: Preprocess link scripts Peter Tyser
2009-10-06  7:28   ` Wolfgang Denk
2009-10-06 11:13     ` Peter Tyser
2009-10-05 23:01 ` [U-Boot] [PATCH 2/2] 85xx: Ensure BSS segment doesn't start at address 0x0 Peter Tyser
2009-10-06  8:54   ` Wolfgang Denk [this message]
2009-10-06 12:10     ` Peter Tyser
2009-10-06  7:32 ` [U-Boot] [PATCH 0/2] Make sure 85xx bss doesn't start at 0x0 Wolfgang Denk
2009-10-06 12:01   ` Peter Tyser
2009-10-06 14:01     ` Wolfgang Denk
2009-10-06 14:07       ` Kumar Gala
2009-10-06 14:24         ` Peter Tyser
2009-10-06 15:22           ` Wolfgang Denk
2009-10-06 15:45             ` Peter Tyser
2009-10-06 17:51               ` Wolfgang Denk
2009-10-06 18:08                 ` Peter Tyser
2009-10-06 20:34                   ` J. William Campbell
2009-10-06 20:53                     ` Peter Tyser
2009-10-06 22:34                       ` J. William Campbell
2009-10-06 23:10                         ` Peter Tyser
2009-10-06 23:25                           ` Wolfgang Denk
2009-10-06 23:43                             ` Peter Tyser
2009-10-07  0:09                               ` Peter Tyser
2009-10-07  1:24                                 ` Graeme Russ
2009-10-07  6:55                                   ` Wolfgang Denk
2009-10-07  9:56                                     ` Graeme Russ
2009-10-07 10:07                                       ` Graeme Russ
2009-10-07 10:32                                       ` Joakim Tjernlund
2009-10-07 14:37                                         ` J. William Campbell
2009-10-07  6:53                               ` Wolfgang Denk
2009-10-07 11:57                                 ` Peter Tyser
2009-10-07 12:19                                   ` Wolfgang Denk
2009-10-06 23:07                       ` Wolfgang Denk
2009-10-06 23:29                         ` Peter Tyser
2009-10-07  6:51                           ` Wolfgang Denk
2009-10-06 20:46                   ` Kumar Gala
2009-10-06 21:13                     ` Peter Tyser
2009-10-06 16:53             ` Stefan Roese
2009-10-06 15:04         ` Wolfgang Denk
2009-10-06 15:20           ` Peter Tyser

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=20091006085409.40E994C021@gemini.denx.de \
    --to=wd@denx.de \
    --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