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: GOLD: RFA: Add support for RX target


DJ Delorie <dj@redhat.com> writes:

>> > +   if (target->uses_bigendian_data ())
>> 
>> s/ ()/()/
>
> Why doesn't gold follow the GNU coding standards?

Because it follows C++ convention.  All C++ code does not have a space
between the function name and the left parenthesis.


>> > +   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".

I don't personally like the implied this->.  I don't think it is a
benefit at all.  I think it is a recipe for confusion.  It is especially
a recipe for confusion in heavily templated code like gold, as name
lookup in templates does not behave as most programmers expect.  This
particular code is not templated at the moment, but it could be later.

In any case, this is the convention used throughout the gold code, and
there is no reason for the rx code to be different.


>> 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.

That sounds quite confusing, but I'm sure we can make it work.  We
should not have to do any code copying here.  Also, calls to
convert_host are most likely incorrect--note that no code in gold calls
it.  In general the right thing should happen by using the right value
for the big_endian template parameter.

Ian


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