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

Dave Korn dave.korn.cygwin@googlemail.com
Tue Aug 11 00:15:00 GMT 2009


Alan Modra wrote:
> On Mon, Aug 10, 2009 at 06:19:12PM +0100, Dave Korn wrote:
>> Alan Modra wrote:
>>
>>> besides the calls to bfd_set_section_contents, which ought to be fixed
>>> by the following patch.  I'm loathe to apply this patch to the
>>> official sources until we have a contributed port that needs it,
>>> because bfd_octets_per_bytes is not exactly a cheap function.  A
>>> proper fix would involve adding an opb_shift or somesuch to the bfd
>>> struct, and using that.
>>   I'm working on a (private) port where octets_per_byte isn't even a power of 2 :-)
> 
> Fun.  ELF or COFF?

  COFF.  ELF is left as an exercise for the reader :-)

  Re: "Fun", I'll just add that I've been pleasantly surprised by how smoothly
it all went; BFD and binutils in general handled it correctly and there were
only trivial bugs.  And CGEN makes it really easy, once you've done it once you
can knock out another port in a matter of days.

  It's mostly working so far but I've got the simulator and debugger yet to do.
 I've been given permission to invent a toy CPU of my own (which will have only
one thing in common, 24-bit bytes) to send upstream so as to be able to
contribute bugfixes with some kind of evidence that they're needed and work; do
you think it would be worth adding the full port to the repository?

    cheers,
      DaveK



More information about the Binutils mailing list