bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

still struggling to produce the same flat binary with both 32 and 64bit


From: me
Subject: still struggling to produce the same flat binary with both 32 and 64bit binutils tool chains
Date: Thu, 7 Jan 2010 20:01:12 +0000

I posted
http://www.mail-archive.com/address@hidden/msg08677.html
on Wed, 09 Dec 2009 14:12:16 -0800

and Alan Modra very kindly advised that I needed to final link the file.

Since that time I have been unable to reproduce the output with 64bit
binutils. I've also tried a couple of forums.

The nearest I've got is this i.e.


.text
_start: .global _start #keeps ld happy
.int blob
blob:

as --32 -o test.o test.s
ld -melf_i386 test.o
objcopy -O binary a.out a.com
hte a.com
produces
00000000 | 58 80 04 08

wich I think is a problem 'cos I was hoping for 
00000000 | 04 00 00 00

The reason for this is that the actual code I want to build, rather than
this tiny example, is a standalone forth image. Once the bootloader has
executed from 0x7c00 and loaded everything into memory it relocates the
whole lot so that it starts at memory address 0x0.

As such I can't help feeling that all addresses should be based on the
presumption that the start of the file is address 0.

If someone could please demonstrate how to get the same 32 bit result
or a commensurate result (a 64bit ,com) that would jump to the right
places from address 0x0 in memory I'd really appreciate it.

On the other hand perhaps 58 80 04 08 is the right result and I'm just
not interpreting it correctly.

As always any help much appreciated.












reply via email to

[Prev in Thread] Current Thread [Next in Thread]