objcopy to binary versus linking to binary

Hans-Peter Nilsson hp@bitrange.com
Wed Mar 14 19:57:00 GMT 2007
On Wed, 14 Mar 2007, Diego 'Flameeyes' Pettenò wrote:
> 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).

My initial guess (not wanting to spend time analyzing this but
having experience doing similar) is that there's a bug in
h8_elf_howto_table.

Why?  Because when linking to ELF, elf32_h8_relocate_section
(elf32_h8_final_link_relocate) is used, but when linking to
another format, the information h8_elf_howto_table is used.

brgds, H-P



More information about the Binutils mailing list