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


Hi Ian,

Thanks for the patch review. Attached is a revised version which addresses all of your comments except one:


+       // This is a copy of the relocate_section() function in target-reloc.h,
+       // except with the additional calls to convert_host to fix up the
+       // extracted information.
+       // FIXME: There ought to be a better way to do 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 comment at the top of the file suggests that the symbol table is also written with big-endian data, in which case I think this code is insufficient.

Anyhow, if the reloc fields are consistenly written big-endian, then the
right approach is not to call convert_host, but instead to change

+ typedef Reloc_types<elfcpp::SHT_RELA, 32, false>::Reloc Reltype;

to


+ typedef Reloc_types<elfcpp::SHT_RELA, 32, true>::Reloc Reltype;

That will cause the reloc code to fetch values big-endian rather than little-endian.

I found it very hard to get the reloc code work correctly for the RX but the current version does that. I did think about splitting up relocate_section in target-reloc.h but I did not want to interfere with already working code just for the vagaries of this one target. (Plus I was not sure that I would not introduce new bugs this way. That and the fact that big-endian data/little-endian code is a rare case for the RX).


So, if it is OK with you I would like to leave the code as it currently is. It may be less efficient, but it does work.

Is this revised version OK ?

Cheers
  Nick

Attachment: rx.gold.patch.2
Description: Unix manual page


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