News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

linking flat binaries

Started by brodeur235, July 27, 2009, 06:24:09 AM

Previous topic - Next topic

brodeur235

I compiled two filesto flat binary, but they won't link using ld. The only format that ld will allow me to link is aout... Here was my test:


[BITS 32]
mov eax,0x00000008

assemble with:
nasm f1.asm -f bin -o f1.o


[BITS 32]
mov ebx,eax

assemble with:
nasm f2.asm -f bin -o f2.o

and then I try and link with:
ld f1.o f2.o

However, I get this error message:
f1.o: file not recognized: File format not recognized

Why won't it link?

Brodeur235

MichaelW

I don't really know if this is of any use, but I get no error with:

ld -b binary f1.o f2.o

On my system objdump -i returns:

BFD header file version 2.13.90 20030111
pe-i386
(header little endian, data little endian)
  i386
pei-i386
(header little endian, data little endian)
  i386
elf32-i386
(header little endian, data little endian)
  i386
elf32-little
(header little endian, data little endian)
  i386
elf32-big
(header big endian, data big endian)
  i386
srec
(header endianness unknown, data endianness unknown)
  i386
symbolsrec
(header endianness unknown, data endianness unknown)
  i386
tekhex
(header endianness unknown, data endianness unknown)
  i386
binary
(header endianness unknown, data endianness unknown)
  i386
ihex
(header endianness unknown, data endianness unknown)
  i386

               pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec
          i386 pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec

               symbolsrec tekhex binary ihex
          i386 symbolsrec tekhex binary ihex


http://sourceware.org/binutils/docs-2.19/ld/Options.html#Options

eschew obfuscation