U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] relocation: Do not relocate NULL pointers.
Date: Wed, 23 Sep 2009 14:25:25 +0200	[thread overview]
Message-ID: <200909231425.25461.sr@denx.de> (raw)
In-Reply-To: <1253708271.3968.11.camel@ptyser-laptop>

On Wednesday 23 September 2009 14:17:51 Peter Tyser wrote:
> On Wed, 2009-09-23 at 13:51 +0200, Joakim Tjernlund wrote:
> > NULL is an absolute value and should not be relocated.
> > After this correction code like:
> >  void weak_fun(void) __attribute__((weak));
> >  printf("weak_fun:%p\n", weak_fun);
> > will still print null after relocation.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > ---
> >
> > I have only tested this on 83xx and on a somewhat older u-boot.
> > The change is exactly the same on all PowerPC platforms though.
> 
> Hi Jocke,
> I made the same changes recently, but ran into an "issue" that prevented
> me from sending the change upstream.  Some boards/arches have the bss at
> address 0 and later relocate it, unlike every other NULL pointer.  If
> you don't fix up the bss address, the board will not function.   If you
> run readelf on an 83xx u-boot image vs a 85xx u-boot image it should be
> more clear what's going on.  I was doing my testing on the XPedite5370
> fwiw.
> 
> In any case, the change as is would break some other arches.  Seems like
> the proper workaround would be to "fix" the 85xx (and other arches) link
> script to locate the bss similar to the 83xx boards.
> 
> It might be nice to consolidate all the ppc relocate code into 1
> function while we were at it.

Yes, please!
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

  reply	other threads:[~2009-09-23 12:25 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-23 11:51 [U-Boot] [PATCH] relocation: Do not relocate NULL pointers Joakim Tjernlund
2009-09-23 12:17 ` Peter Tyser
2009-09-23 12:25   ` Stefan Roese [this message]
2009-09-23 12:30   ` Joakim Tjernlund
2009-09-23 12:57     ` Peter Tyser
2009-09-23 16:53       ` Joakim Tjernlund
2009-09-23 18:23       ` Wolfgang Denk
2009-09-27 13:15         ` Joakim Tjernlund
2009-09-27 13:52           ` Graeme Russ
2009-09-27 16:18             ` Joakim Tjernlund
2009-09-27 23:23               ` Graeme Russ
2009-09-28  7:28                 ` Joakim Tjernlund
2009-09-28  4:31           ` Peter Tyser
2009-09-28  7:34             ` Joakim Tjernlund
2009-09-28 12:45               ` Peter Tyser
2009-09-28 13:15                 ` Joakim Tjernlund
2009-09-28 14:29                   ` Peter Tyser
2009-09-28 14:47                     ` Joakim Tjernlund
2009-09-28 14:41                 ` Joakim Tjernlund
2009-09-28 15:08                   ` Peter Tyser
2009-09-28 15:23                     ` Joakim Tjernlund
2009-09-28 15:37                       ` Joakim Tjernlund
2009-10-03  8:13                         ` Wolfgang Denk
     [not found]                           ` <OF3474ED49.C18DA041-ONC1257 <20091003142823.F037D832E408@gemini.denx.de>
2009-10-03  9:28                           ` Joakim Tjernlund
2009-10-03 12:13                             ` Wolfgang Denk
2009-10-03 13:34                               ` Joakim Tjernlund
2009-10-03 13:45                               ` Peter Tyser
2009-10-03 14:28                                 ` Wolfgang Denk
2009-10-03 15:09                                   ` Joakim Tjernlund
2009-10-03 19:31                                     ` Wolfgang Denk
2009-10-05 23:20                                     ` Peter Tyser
2009-10-06  8:58                                       ` Wolfgang Denk
2009-10-06 10:56                                         ` Joakim Tjernlund
2009-10-05 20:07         ` Peter Tyser
2009-10-05 21:18           ` Wolfgang Denk
2009-10-06 17:12             ` Scott Wood
2009-10-06 17:52               ` Wolfgang Denk
2009-09-23 12:24 ` Stefan Roese
2009-09-23 12:33   ` Joakim Tjernlund
  -- strict thread matches above, loose matches on Subject: below --
2009-10-07 23:42 Joakim Tjernlund
2009-10-07 23:49 ` Peter Tyser
2009-10-08  0:03   ` Joakim Tjernlund
2009-10-08  0:03 Joakim Tjernlund
2009-10-08  7:38 ` Wolfgang Denk
2009-10-08  8:56   ` Joakim Tjernlund
2009-10-08 12:44     ` Wolfgang Denk
2009-10-08 13:35       ` Joakim Tjernlund
2009-10-08 13:40     ` Peter Tyser
2009-10-08 22:16       ` Wolfgang Denk

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=200909231425.25461.sr@denx.de \
    --to=sr@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