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]

Re: How to use bits_per_byte (~OCTETS_PER_BYTE) of bfd_arch_info_type in binutils port?


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


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