This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: objcopy to binary versus linking to binary
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Diego 'Flameeyes' Pettenò <flameeyes at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 14 Mar 2007 15:57:48 -0400 (EDT)
- Subject: Re: objcopy to binary versus linking to binary
- References: <200703141833.25292@enterprise.flameeyes.is-a-geek.org>
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