This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GOLD: RFA: Add support for RX target
- From: DJ Delorie <dj at redhat dot com>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: binutils at sourceware dot org, nickc at redhat dot com
- Date: Mon, 13 Dec 2010 16:58:38 -0500
- Subject: Re: GOLD: RFA: Add support for RX target
- References: <m3zksa6j4v.fsf@redhat.com> <m3pqt5a61e.fsf@pepe.airs.com>
> > + if (target->uses_bigendian_data ())
>
> s/ ()/()/
Why doesn't gold follow the GNU coding standards?
> > + if (uses_bigendian_data ())
>
> This line should be
> if (this->uses_bigendian_data())
Why? This throws away the huge benefit of having the implied "this".
> Yes, there ought to be a better way to do this. If your code is
> correct, then it looks like the problem is that you have a little-endian
> object but the reloc fields are written with big-endian data.
The RX chip has selectable endianness for data, but always uses the
same endianness for opcode fields. Unfortunately, the opcode LINE
fetch *does* go through the data endianness swapper, so you have to
compensate for that when generating the final ELF image. I.e. opcode
*fields* are not swapped, but the opcode *section* *is*.
As an aside, the external bus unit allows you to *further* specify
endianness (as same vs swapped) on a per-chip-select basis, for
external peripherals. So executing from external RAM may involve up
to three swaps (linker, bus, fetch) before an opcode is executed.