[PATCH 04/12] bfd, include, ld, binutils, libctf: CTF should use the dynstr/sym

Nick Alcock nick.alcock@oracle.com
Fri Nov 20 14:52:12 GMT 2020


On 18 Nov 2020, Nick Alcock via Binutils verbalised:

> On 17 Nov 2020, Alan Modra told this:
>
>> On Sun, Oct 25, 2020 at 02:14:05PM +0000, Nick Alcock via Binutils wrote:
>>> Some bits might be contentious.  The ctf_new_dynstr callback takes an
>>> elf_internal_sym, and this remains an elf_internal_sym right down
>>> through the generic emulation layers into ldelfgen.  This is no worse
>>
>> Yeah, I would have preferred not needing elf/internal.h in ld, but
>> it's not so unreasonable in ELF specific ld files.
>>
>> So, patch is OK.  I think that gets you to the point where you can
>> commit the patch series.
>
> Thank you! I'll rebase and do the usual round of retesting, then if that
> passes -- which it should -- push (in the next day, probably).

Done, pushed! One last-minute bug emerged: lookups of symbols in
cross-endian builds and quite possibly emission in cross-endian links is
still broken, but then it always was broken for offsets into the ELF
strtab anyway so I consider this a separate problem to fix in another
push (the next one).

I think I can fix this with very minimal change outside libctf, perhaps
one extra function call so that the linker can tell libctf the
endianness of the target it's linking for, and another similar call in
readelf (since readelf can't just pass a bfd in to libctf which it can
use to figure out endianness).


More information about the Binutils mailing list