[PATCH] D107747: [ELF] Don't emit SHF_GNU_RETAIN on Solaris

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 9 10:10:04 PDT 2021


MaskRay added a comment.

In D107747#2934864 <https://reviews.llvm.org/D107747#2934864>, @tmatheson wrote:

> According to D95749 <https://reviews.llvm.org/D95749>, the rationale for allowing `ELFOSABI_NONE` with `SHF_GNU_RETAIN` is to keep consistent behaviour with `STT_GNU_IFUNC` and `STB_GNU_UNIQUE`, which are permitted under `ELFOSABI_NONE`. @MaskRay Should we perhaps revisit that decision?
>
> More details at https://sourceware.org/bugzilla/show_bug.cgi?id=27282

The Solaris Linkers and Loader guide doesn't say the section type value 10 is used.
We can mark STT_GNU_IFUNC as ELFOSABI_GNU, it just feels to me not very necessary. (It can be used by multiple other OSABI values. All these OSABI need to something similar to D107748 <https://reviews.llvm.org/D107748> even if NONE works)

I think STB_GNU_UNIQUE is a mistake.
Clang doesn't emit it.
So marking it as ELFOSABI_GNU isn't too necessary.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107747/new/

https://reviews.llvm.org/D107747



More information about the llvm-commits mailing list