This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to use bits_per_byte (~OCTETS_PER_BYTE) of bfd_arch_info_type in binutils port?
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Martin Walter <martin dot walter at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 7 Aug 2009 09:35:28 +0930
- Subject: Re: How to use bits_per_byte (~OCTETS_PER_BYTE) of bfd_arch_info_type in binutils port?
- References: <c55980430908061039u692e41beqb595c1f7cc2d7419@mail.gmail.com>
On Thu, Aug 06, 2009 at 07:39:17PM +0200, Martin Walter wrote:
> Now I experience a problem in '_bfd_relocate_contents()' in
> 'bfd/reloc.c' where the address of a relocatable instruction is given
> as an index to a 16-bit instruction,
Yes.
> but 'bfd_get16(location)' seems
> to be interpreting the location value as a byte index:
Well why not? After all, "location" just points into the section
contents, an array of bytes.
> Where is my mistake? Are there any other parts of the binutils that
> would need to be changed in order to get this work?
There are at least two other binutils ports that work with
OCTETS_PER_BYTE greater than one, tic4x and tic54x. You should look
at them if you have not done so already. Unfortunately, they are both
COFF. The generic ELF code is missing some conversions between octets
and bytes (one such is on calls to bfd_set_section_contents in
elflink.c). You get to fix it. :-)
--
Alan Modra
Australia Development Lab, IBM