All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0
@ 2006-11-30 21:09 Chris Fester
  2006-11-30 22:17 ` Tolunay Orkun
  2006-11-30 23:15 ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Fester @ 2006-11-30 21:09 UTC (permalink / raw)
  To: u-boot

Hi all,

I recently have been attempting to get u-boot working on my MPC8641HPCN
evaulation board (AKA the Argo Navis platform).  I faced a problem
compiling the latest git source with the ELDK 4.0 and getting it to work
on the board.  The processor would run off into the weeds when doing the
command table relocation step in lib_ppc/board.c:633.  After debugging
with a BDI, some head scratching, and a few google searches, it came
down to an issue with the linker, which seems to have been a common
problem in the past for this mail list.  Please see the thread at:
http://sourceware.org/ml/binutils/2005-08/msg00412.html.

The information from that link is what I used to compose the patch
below.

(Synopsis of the above web link - the newer linker needs to be told more
specifically where to put the __u_boot_cmd_start symbol, otherwise it
decides to put other misc symbols between __u_boot_cmd_start and
__u_boot_cmd_end, causing all sorts of funk when iterating through the
command array.)

After I apply this patch the u-boot is hunky-dory and happy.

Happy holidays!  :)
Chris Fester

CHANGELOG
 
* Fix to linker script for mpc8641hpcn platform to enable a correct
    symbol table with ELDK 4.0 linker.


diff --git a/board/mpc8641hpcn/u-boot.lds b/board/mpc8641hpcn/u-boot.lds
index b34de8e..c2f6727 100644
--- a/board/mpc8641hpcn/u-boot.lds
+++ b/board/mpc8641hpcn/u-boot.lds
@@ -120,7 +120,7 @@ SECTIONS
   _edata  =  .;
   PROVIDE (edata = .);

-  __u_boot_cmd_start = .;
+  __u_boot_cmd_start = ADDR(.u_boot_cmd);
   .u_boot_cmd : { *(.u_boot_cmd) }
   __u_boot_cmd_end = .;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0
  2006-11-30 21:09 [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0 Chris Fester
@ 2006-11-30 22:17 ` Tolunay Orkun
  2006-11-30 23:15 ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Tolunay Orkun @ 2006-11-30 22:17 UTC (permalink / raw)
  To: u-boot

Chris Fester wrote:
> Hi all,
> 
> I recently have been attempting to get u-boot working on my MPC8641HPCN
> evaulation board (AKA the Argo Navis platform).  I faced a problem
> compiling the latest git source with the ELDK 4.0 and getting it to work
> on the board.  The processor would run off into the weeds when doing the
> command table relocation step in lib_ppc/board.c:633.  After debugging
> with a BDI, some head scratching, and a few google searches, it came
> down to an issue with the linker, which seems to have been a common
> problem in the past for this mail list.  Please see the thread at:
> http://sourceware.org/ml/binutils/2005-08/msg00412.html.


I answered the same issue for someone else this week. This issue is 
fixed by the patch that went in Aug 31, 2005. As far as I can see, the 
change was for all boards in the public tree back then.

http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=807d5d7319330e336ab34a5623c5e0d73b87d540

>  
> * Fix to linker script for mpc8641hpcn platform to enable a correct
>     symbol table with ELDK 4.0 linker.
> 
> 
> diff --git a/board/mpc8641hpcn/u-boot.lds b/board/mpc8641hpcn/u-boot.lds
> index b34de8e..c2f6727 100644
> --- a/board/mpc8641hpcn/u-boot.lds
> +++ b/board/mpc8641hpcn/u-boot.lds
> @@ -120,7 +120,7 @@ SECTIONS
>    _edata  =  .;
>    PROVIDE (edata = .);
> 
> -  __u_boot_cmd_start = .;
> +  __u_boot_cmd_start = ADDR(.u_boot_cmd);
>    .u_boot_cmd : { *(.u_boot_cmd) }
>    __u_boot_cmd_end = .;


Please that a look at the fix done for other boards (say mpc8560ads). 
They add two lines of ". = ." which fixes this and a similar issue with 
__start___ex_table symbol. I think it would be better if the issue is 
fixed in the same way. (I am not saying your solution is wrong, but this 
is more consistent)

Tolunay


PS: Wolfgang, perhaps this should be a FAQ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0
  2006-11-30 21:09 [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0 Chris Fester
  2006-11-30 22:17 ` Tolunay Orkun
@ 2006-11-30 23:15 ` Wolfgang Denk
  2006-12-01 22:16   ` Chris Fester
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2006-11-30 23:15 UTC (permalink / raw)
  To: u-boot

In message <1164920966.323.30.camel@kaboom.lisle.iphase.com> you wrote:
>
> diff --git a/board/mpc8641hpcn/u-boot.lds b/board/mpc8641hpcn/u-boot.lds
> index b34de8e..c2f6727 100644
> --- a/board/mpc8641hpcn/u-boot.lds
> +++ b/board/mpc8641hpcn/u-boot.lds
> @@ -120,7 +120,7 @@ SECTIONS
>    _edata  =  .;
>    PROVIDE (edata = .);
> 
> -  __u_boot_cmd_start = .;
> +  __u_boot_cmd_start = ADDR(.u_boot_cmd);
>    .u_boot_cmd : { *(.u_boot_cmd) }
>    __u_boot_cmd_end = .;

I think there should be a ". = .;" line before the __u_boot_cmd_start
like we do on other boards. Please verify that this  works  for  you,
too, and resubmit.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I say we take off; nuke the site from orbit. It's the only way to be
sure."                                  - Corporal Hicks, in "Aliens"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0
  2006-11-30 23:15 ` Wolfgang Denk
@ 2006-12-01 22:16   ` Chris Fester
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Fester @ 2006-12-01 22:16 UTC (permalink / raw)
  To: u-boot

Okie, my resubmission.  Just tested 5 minutes ago and works.  Thanks for
the feedback.  :)

Chris

CHANGELOG
 
* Fix to linker script for mpc8641hpcn platform to enable a correct
    symbol table with ELDK 4.0 linker.


diff --git a/board/mpc8641hpcn/u-boot.lds b/board/mpc8641hpcn/u-boot.lds
index b34de8e..13c1acf 100644
--- a/board/mpc8641hpcn/u-boot.lds
+++ b/board/mpc8641hpcn/u-boot.lds
@@ -120,10 +120,12 @@ SECTIONS
   _edata  =  .;
   PROVIDE (edata = .);

+  . = .;
   __u_boot_cmd_start = .;
   .u_boot_cmd : { *(.u_boot_cmd) }
   __u_boot_cmd_end = .;

+  . = .;
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;



On Fri, 2006-12-01 at 00:15 +0100, Wolfgang Denk wrote:
> In message <1164920966.323.30.camel@kaboom.lisle.iphase.com> you wrote:
> >
> > diff --git a/board/mpc8641hpcn/u-boot.lds b/board/mpc8641hpcn/u-boot.lds
> > index b34de8e..c2f6727 100644
> > --- a/board/mpc8641hpcn/u-boot.lds
> > +++ b/board/mpc8641hpcn/u-boot.lds
> > @@ -120,7 +120,7 @@ SECTIONS
> >    _edata  =  .;
> >    PROVIDE (edata = .);
> > 
> > -  __u_boot_cmd_start = .;
> > +  __u_boot_cmd_start = ADDR(.u_boot_cmd);
> >    .u_boot_cmd : { *(.u_boot_cmd) }
> >    __u_boot_cmd_end = .;
> 
> I think there should be a ". = .;" line before the __u_boot_cmd_start
> like we do on other boards. Please verify that this  works  for  you,
> too, and resubmit.
> 
> Best regards,
> 
> Wolfgang Denk
> 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-01 22:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 21:09 [U-Boot-Users] [PATCH] MPC8641HPCN u-boot.lds problem with ELDK 4.0 Chris Fester
2006-11-30 22:17 ` Tolunay Orkun
2006-11-30 23:15 ` Wolfgang Denk
2006-12-01 22:16   ` Chris Fester

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.