I copied some 32bit (.com) examples over.
Using 32bit binutils and the command line "as test.s; objcopy -O binary a.out a.com; hte a.com"
I was able to transform the code...
Code: Select all
.int blob
blob:
which is what I expected to see
This didn't work using 64bit binutils and I was told
a) its 'cos the relocs work differently in 64bit binutils &
b) that I'd need to use ld
My attempts over the last few days, using 64bit bin utils, have failed to reproduce the binary
and I wonder if someone show me how it's done with a little explanation.
This is as far as I got
Code: Select all
.text
_start: .global _start #keeps ld happy
.int blob
blob:
built with
as -o test.o test.s
ld -s -o test test.o
objcopy -O binary test a.com
gives "00000000 7c 00 40 00"
Assembling with nasm instead of as & then using ld gives a similar result but I think was 80 instead of 7c.
Perhaps this is correct and I just don't know what I'm looking at.
BTW nasm & fasm without any "help" from binutils reproduces the binaries on the 64bit OS just like they used to on my old PIII.
Any help appreciated.
Dean