Re: [U-Boot] Instructions in TEXT section can not load data from other section

2010-03-17 Thread jrjr

Thanks for your advise, I compile with -mrelocatable. If I remove this flag, 
Error is shown:

ERROR: Your compiler doesn't generate .fixup sections!

My host gcc is  gcc 4.1.2 20080704 (Red Hat 4.1.2-44),
I try different toolchain:
powerpc-unknown-linux-gnu-gcc  gcc version 4.4.3 (crosstool-NG-1.6.0)
ppc_82xx-gcc gcc version 4.2.2   from ELDK
powerpc-603-linux-gnu-gcc gcc version 4.1.0 from crosstool 0.43

The problem is still there: (   

--JRJR


 Subject: Re: [U-Boot] Instructions in TEXT section can not load data from 
 other   section
 To: jason...@hotmail.com
 CC: u-boot@lists.denx.de
 From: joakim.tjernl...@transmode.se
 Date: Tue, 16 Mar 2010 09:50:42 +0100
 
 
  Hi, everyone.
 
   I have got a problem when I porting U-BOOT to my board
 
  with MPC8247. My configuration file is based on the MPC8260ADS_config.
 
  The problem is : The instruction in TEXT section can not load data in
 
  other (DATA) sections. It seems there is a relocation to the data section .
 
  For example:   If I use
 
  for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
  if ((*init_fnc_ptr) () != 0) {
  hang ();
  }
  }
 
  I can't jump to functions in  init_sequence[]  ;
 
  If I called functions such asget_clocks()  in board_init_f  , it works 
  fine.
 
  So the code in board_init_f can not load address in init_sequence[] , 
  because
 
  init_sequence[]  is out of TEXT section.
 
  The same thing happens with iop_conf_tab[][], and strings used by puts.
 
  Anyone there has the same problem? Or know the point? Pls help!
 
 Yes, that is a relocation problem. Do you compile with -mrelocatable?
 If so, you might have a broken toolchain that don't produce .fixups
 
 jocke
 
  
_
SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻!
http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Instructions in TEXT section can not load data from other section

2010-03-17 Thread jrjr

jocke,

Thanks for your advise,  my lds file is from cpu/mpc8260/u-boot.lds ; I don't 
change it.
Here is the fixup part:

--
  .reloc   :
  {
*(.got)
_GOT2_TABLE_ = .;
*(.got2)
_FIXUP_TABLE_ = .;
*(.fixup)
  }
  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_)  2;
  __fixup_entries = (. - _FIXUP_TABLE_)  2;


And my TEXT_BASE is 0xFFF8 , because my boot flash is 0.5MB .
I can execute instructions in text section after power on reset.
Is there anything wrong with this configure?
Thanks for your help.

--JRJR


 Subject: RE: [U-Boot] Instructions in TEXT section can not load data from 
 other   section
 To: jason...@hotmail.com
 CC: u-boot@lists.denx.de
 From: joakim.tjernl...@transmode.se
 Date: Wed, 17 Mar 2010 08:05:23 +0100
 
 jrjr jason...@hotmail.com wrote on 2010/03/17 07:28:04:
 
  Thanks for your advise, I compile with -mrelocatable. If I remove this flag,
  Error is shown:
 
  ERROR: Your compiler doesn't generate .fixup sections!
 
  My host gcc is  gcc 4.1.2 20080704 (Red Hat 4.1.2-44),
  I try different toolchain:
  powerpc-unknown-linux-gnu-gcc  gcc version 4.4.3 (crosstool-NG-1.6.0)
  ppc_82xx-gcc gcc version 4.2.2   from ELDK
  powerpc-603-linux-gnu-gcc gcc version 4.1.0 from crosstool 0.43
 
  The problem is still there: (
  
  --JRJR
 
 Check your linker script(*.lds) for .fixup sections and compare
 that to a working working board.
 OR
 Your TEXT_BASE is wrong
 
 
 
   Subject: Re: [U-Boot] Instructions in TEXT section can not load data from
  other section
   To: jason...@hotmail.com
   CC: u-boot@lists.denx.de
   From: joakim.tjernl...@transmode.se
   Date: Tue, 16 Mar 2010 09:50:42 +0100
  
   
Hi, everyone.
   
I have got a problem when I porting U-BOOT to my board
   
with MPC8247. My configuration file is based on the MPC8260ADS_config.
   
The problem is : The instruction in TEXT section can not load data in
   
other (DATA) sections. It seems there is a relocation to the data 
section .
   
For example: If I use
   
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr) () != 0) {
hang ();
}
}
   
I can't jump to functions in init_sequence[] ;
   
If I called functions such as get_clocks() in board_init_f , it works 
fine.
   
So the code in board_init_f can not load address in init_sequence[] , 
because
   
init_sequence[] is out of TEXT section.
   
The same thing happens wit h iop_conf_tab[][], and strings used by 
puts.
   
Anyone there has the same problem? Or know the point? Pls help!
  
   Yes, that is a relocation problem. Do you compile with -mrelocatable?
   If so, you might have a broken toolchain that don't produce .fixups
  
   jocke
  
 
  聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载!
  
_
约会说不清地方?来试试微软地图最新msn互动功能!
http://ditu.live.com/?form=TLswm=1___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Instructions in TEXT section can not load data from other section

2010-03-17 Thread jrjr

And I have made some change in cpu/mpc8260/start.S, I removed following lines:

#ifndef CONFIG_SYS_RAMBOOT
/* When booting from ROM (Flash or EPROM), clear the*/
/* Address Mask in OR0 so ROM appears everywhere*/
/*--*/

lisr3, (CONFIG_SYS_IMMR+IM_REGBASE)@h
lwzr4, im_...@l(r3)
lir5, 0x7fff
andr4, r4, r5
stwr4, im_...@l(r3)

/* Calculate absolute address in FLASH and jump there*/
/*--*/

lisr3, config_sys_monitor_b...@h
orir3, r3, config_sys_monitor_b...@l
addir3, r3, in_flash - _start + EXC_OFF_SYS_RESET
mtlrr3
blr

in_flash:
#endif/* CONFIG_SYS_RAMBOOT */

Becasue I don't think I need to clear the Address Mask in OR0, Is there 
anything wrong?

--JRJR

 Subject: RE: [U-Boot] Instructions in TEXT section can not load data from 
 other   section
 To: jason...@hotmail.com
 CC: u-boot@lists.denx.de
 From: joakim.tjernl...@transmode.se
 Date: Wed, 17 Mar 2010 08:05:23 +0100
 
 jrjr jason...@hotmail.com wrote on 2010/03/17 07:28:04:
 
  Thanks for your advise, I compile with -mrelocatable. If I remove this flag,
  Error is shown:
 
  ERROR: Your compiler doesn't generate .fixup sections!
 
  My host gcc is  gcc 4.1.2 20080704 (Red Hat 4.1.2-44),
  I try different toolchain:
  powerpc-unknown-linux-gnu-gcc  gcc version 4.4.3 (crosstool-NG-1.6.0)
  ppc_82xx-gcc gcc version 4.2.2   from ELDK
  powerpc-603-linux-gnu-gcc gcc version 4.1.0 from crosstool 0.43
 
  The problem is still there: (
  
  --JRJR
 
 Check your linker script(*.lds) for .fixup sections and compare
 that to a working working board.
 OR
 Your TEXT_BASE is wrong
 
 
 
   Subject: Re: [U-Boot] Instructions in TEXT section can not load data from
  other section
   To: jason...@hotmail.com
   CC: u-boot@lists.denx.de
   From: joakim.tjernl...@transmode.se
   Date: Tue, 16 Mar 2010 09:50:42 +0100
  
   
Hi, everyone.
   
I have got a problem when I porting U-BOOT to my board
   
with MPC8247. My configuration file is based on the MPC8260ADS_config.
   
The problem is : The instruction in TEXT section can not load data in
   
other (DATA) sections. It seems there is a relocation to the data 
section .
   
For example: If I use
   
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr) () != 0) {
hang ();
}
}
   
I can't jump to functions in init_sequence[] ;
   
If I called functions such as get_clocks() in board_init_f , it works 
fine.
   
So the code in board_init_f can not load address in init_sequence[] , 
because
   
init_sequence[] is out of TEXT section.
   
The same thing happens wit h iop_conf_tab[][], and strings used by 
puts.
   
Anyone there has the same problem? Or know the point? Pls help!
  
   Yes, that is a relocation problem. Do you compile with -mrelocatable?
   If so, you might have a broken toolchain that don't produce .fixups
  
   jocke
  
 
  聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载!
  
_
SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻!
http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Instructions in TEXT section can not load data from other section

2010-03-16 Thread jrjr


Hi, everyone. 

 I have got a problem when I porting U-BOOT to my board

with MPC8247. My configuration file is based on the MPC8260ADS_config.

The problem is : The instruction in TEXT section can not load data in

other (DATA) sections. It seems there is a relocation to the data section .  

For example:   If I use

for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr) () != 0) {
hang ();
}
}  

I can't jump to functions in  init_sequence[]  ;

If I called functions such asget_clocks()  in board_init_f  , it works fine.

So the code in board_init_f can not load address in init_sequence[] , because

init_sequence[]  is out of TEXT section.   

The same thing happens with iop_conf_tab[][], and strings used by puts.  

Anyone there has the same problem? Or know the point? Pls help!  

Great Great Thanks !  
---
-JRJR

  
_
SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻!
http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot