[PATCH 1/4] elf: Add definition for SHT_LLVM_ADDRSIG.
Peter Collingbourne
pcc@google.com
Fri May 27 17:28:23 GMT 2022
On Thu, May 26, 2022 at 3:37 AM Tatsuyuki Ishi via Binutils
<binutils@sourceware.org> wrote:
>
> > Values in [..._LOOS,..._HIOS] pertain to particular OSes (i.e.
> > ELFOSABI_* values in the header). LLVM isn't really an OS by itself
> > (and I'm also unaware of ELFOSABI_LLVM existing), so I expect there
> > are certain ELFOSABI_* values to which SHT_LLVM_* apply. Otherwise
> > how are collisions with other OSes' SHT_<OS>_... values avoided?
>
> I'm not a LLVM contributor, but unfortunately it seems like the answer
> is that they do not follow the practice of constraining these values
> based on EI_OSABI, and they are basically treated as same as non-OS
> specific values [1].
>
> [1] https://github.com/llvm/llvm-project/blob/09c2b7c35af8c4bad39f03e9f60df8bd07323028/llvm/lib/Object/ELF.cpp#L232-L307
Hi,
The LLVM section types are in a carveout of the GNU OSABI range, as
previously agreed on the GNU gABI list:
https://sourceware.org/pipermail/gnu-gabi/2017q1/000157.html
If other OSs want to adopt the LLVM section types, they will need to
create the same carveout in their OSABI.
>From the GNU binutils perspective, I think these should be treated the
same as the SHT_GNU_* section types. I'm not sure of the reason why
the LLVM ELF parser doesn't consider the OSABI for the GNU/LLVM
section types, but it may just be that there hasn't yet been a need to
do so.
Peter
More information about the Binutils
mailing list