[U-Boot-Users] Does u-boot relocate absolute symbols?

Wolfgang Denk wd at denx.de
Thu Jun 30 12:46:34 CEST 2005


In message <NJF2NIMJ61Z631T0787IG4284GAA7.42c3a2fd at pc-block> you wrote:
> 
> Sure, I've tried this. This is the point, where my problem arose. Attached you find two 
> small files, you can easily compile under linux (gcc -o arrtest -I ./ ./common.c 
> ./array.c). The file "common.c" represents the code I can't (don't want to) touch. 

This example does not demonstrate  anything.  Of  course  a  standard
application  code  example in a Linux environment will not work. Also
you example code seems to show a different situation that you claimed
to have.

> "array.c" represents my project dependent code. If you run arrtest it will show to you, 
> that it is not possible to initialize the array "test" in this manner. After looking at 
> the disassembly, it is pretty clear, that the compiler has to generate different code 
> for the two notations.

Remember that in U-Boot you can:

1) play tricks with the linker script
2) play tricks in your board specific configuration file  which  gets
   included everwhere

For example, you can can re-#define the variables (like  "walter"  in
your example) to use a different name and/or to include some trickery
like  "__attribute__  ((section("???")))"  stuff  to place this array
into a special section which then  gets  treated  specially  in  your
linker script, etc.

This is U-Boot, and you have *full* control over what you are  doing,
which is very unlike compared to a standard Linux application example
-  you  are comparing apples and bananas here (they have one thing in
common, though: I like them both :-).

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
It's hard to make a program foolproof because fools are so ingenious.




More information about the U-Boot mailing list