[PATCH 00/19] libctf, and CTF support for objdump and readelf
Pedro Alves
palves@redhat.com
Fri May 24 16:19:00 GMT 2019
On 5/24/19 5:04 PM, Nick Alcock wrote:
> On 24 May 2019, Pedro Alves spake thusly:
>> Even if you only want to support CTF on ELF containers, a cross
>> binutils build hosted on e.g., Windows, targeting an ELF port, should
>> still be able to use the CTF. That's why it is important to not rely
>> on host headers for ELF definitions. It wasn't clear to me from
>> your remarks above whether the cross use case is considered?
>
> My v2 posting (already out) and v3 (to be posted today, with a
> bfdization layer that actually works and a bunch of interface changes to
> make it more useful, and an example use in objdump) appear in my testing
> to work on mingw, at least. I think that's a non-ELF-capable host.
Yes, mingw/Windows uses COFF/PE, not ELF.
>
> Avoiding relying on host ELF headers is also important because the ELF
> header I was unthinkingly relying on isn't portable outside glibc on
> Linux and perhaps Solaris, and that's definitely not portable enough.
>
> (We do still *need* a few lines of stuff from ELF headers, because the
> low-level symbol lookup parts of libctf cannot rely on having a bfd
> available, so we have to do symbol walkiing by hand -- but we don't need
> the host to provide those few lines, and we do use BFD to get section
> content etc when possible now.)
Awesome. Sorry, I'm way behind on the lists.
If everything works in a cross endianness setting too (e.g., big endian
host x little endian target) then you're golden. :-)
Thanks,
Pedro Alves
More information about the Binutils
mailing list