[U-Boot-Users] mkimage on 64bit

Wolfgang Denk wd at denx.de
Wed Sep 6 23:02:29 CEST 2006


Dear David,

in message <edmpdq$u74$1 at sea.gmane.org> you wrote:
> 
> Unless something like enclosed patch is applied, tools/mkimage cannot 
> show image headers when built on 64bit platform, due to size problem of
> 'unsigned long'.

First, I think your patch is inconsequent:

>  		uint32_t pos;
> -		unsigned long *len_ptr = (unsigned long *) (
> +		uint32_t *len_ptr = (uint32_t *) (
>  					(unsigned long)hdr + sizeof(image_header_t)
>  				);

If you change the "unsigned long" in the first line, then you probably
want to change the "(unsigned long)hdr", too.

>From you patch it seems that on your platform a pointer to  "unsigned
long"  is  different  from  a pointer to uint32_t? Is this really the
case?

I cannot confirm your problem on a 64 bit AMD Opteron system:

-> file ./mkimage
./mkimage: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV),
for GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped
-> ./mkimage -l /tftpboot/ebony/uImage
Image Name:   Linux-2.6.14-rc1-gd8ac1063
Created:      Wed Sep 14 14:57:10 2005
Image Type:   PowerPC Linux Kernel Image (gzip compressed)
Data Size:    947802 Bytes = 925.59 kB = 0.90 MB
Load Address: 0x00000000
Entry Point:  0x00000000

So for me this works fine.

Can you please explain which sort of system you are working on, and
what's going on there?

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
Of all possible committee reactions to any  given  agenda  item,  the
reaction  that will occur is the one which will liberate the greatest
amount of hot air.                                -- Thomas L. Martin




More information about the U-Boot mailing list