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

Andreas Block andreas.block at esd-electronics.com
Thu Jun 30 09:45:01 CEST 2005


29.06.2005 17:46:03, "Rune Torgersen" <runet at innovsys.com> wrote:

>I just have to comment on this.
>
>> It does not work (because it's simply wrong) to declare 
>> fpgadata as follows in pf5200.c 
>> (although looking good in the first place, if you think about 
>> it, the compiler needs to 
>> handle both declarations differently):
>> 
>> const unsigned char *fpgadata = 0x400000; /* (with 0x400000 
>> being the address to store 
>> the image with TFTP at) */
>> 
>
>Have you tried to do this?
>Because it should work (even if one is declared char [] and the other
>char *)

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. 
"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.

Nevertheless, thanks for your hint,
Andreas Block

-------------- next part --------------
A non-text attachment was scrubbed...
Name: array.c
Type: application/octet-stream
Size: 152 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050630/a9e4fc89/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: common.c
Type: application/octet-stream
Size: 120 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050630/a9e4fc89/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: common.h
Type: application/octet-stream
Size: 21 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050630/a9e4fc89/attachment-0002.obj 


More information about the U-Boot mailing list