This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

objcopy to binary versus linking to binary


Hi,

I've been working on a way to streamline the building of a stripped down 
firmware object for h8300, which is required to be in binary format (as the 
loader can only run bare code).

If I link the object files in an ELF file and then use objcopy to output them 
to binary, the code is correct and work sfine.
If I link the object files directly in a binary file through the linker 
script, some bytes are off, for instance the branch instructions points to an 
address 1 byte off the correct one (and so aren't even disasembled correctly 
by objdump later on).

I'm not sure if I'm missing something, or if it's some kind of bug, I don't 
see why the two methods results in two different binaries, but I might have 
misunderstood something, so if someone can point me to some manual, I'd 
gladly RTFM, but as far as I can see on the ld manual there should be no 
reason for the results to be any different.

I'm attaching the output from objdump for the two files, if someone has an 
idea how to handle them.

-- 
Diego "Flameeyes" Pettenò
http://farragut.flameeyes.is-a-geek.org/

Attachment: test_fibonacci.asm
Description: Text document

Attachment: test_fibonacci.elf.asm
Description: Text document

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]