compile zImage give different binary file in 32bit and 64bit system

Xiangfu Liu xiangfu at sharism.cc
Fri Sep 24 22:40:05 EDT 2010


Hi 

the hello.c is the create the same binary:
compile by "mipsel-openwrt-linux-gcc hello.c -o hello"

http://www.openmobilefree.net/other/downloads/tmp/hello.32bit/
http://www.openmobilefree.net/other/downloads/tmp/hello.64bit/

On 09/24/2010 10:28 PM, Alan Post wrote:
> That is troubling.
> 
> Can you compile:
> 
> <++> hello.c
> #include <stdlib.h>
> #include <stdio.h>
> 
> int main(int argc, char *argv[])
> {
>   printf("%s\n", "hello, world")
>   exit(0);
> }
> <-->
> 
> And compare the object file created as well as the executable
> created? 
> 
> I'd like to know if the linker is doing something funny or if
> it is the compiler.  I suspect it is the compiler, from the
> error message you get below.
> 
> Assuming that, we'd be able to figure out what is different by
> writing programs that access structs, do weird things with memory
> alignment, or just do some register rearrangement.
> 
> -Alan
> 
> On Fri, Sep 24, 2010 at 09:44:24PM +0800, Xiangfu Liu wrote:
>> Hi all
>>
>> I have compiled the zImage in openwrt-xburst.git in 
>> two different system: 32bit and 64bit
>>
>> then use hexdump dump the zImage.bin file.
>> use diff to check two hexdump text file.
>> there are a lot of different.
>>
>> is that normal??
>> why it's give different binary file in 32bit and 64bit system.
>>
>>
>> for example:
>> use current config.xbboot file:
>>
>> compile in 64bit system it works fine.
>> compile in 32bit system. it give me :
>> CPU 0 Unable to handle kernel paging request at virtual address 59c54040, epc == 8005c708, ra == 8008058c
>> (see attach for detail message)
>>
>>

-- 
Best Regards
Xiangfu Liu
http://www.nanonote.cc




More information about the discussion mailing list


interactive