[PATCH] D107861: [MC] Change ELFOSABI_NONE to ELFOSABI_GNU for STB_GNU_UNIQUE

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 16:48:42 PDT 2021


MaskRay added a comment.

In D107861#2968314 <https://reviews.llvm.org/D107861#2968314>, @jrtc27 wrote:

> In D107861#2968305 <https://reviews.llvm.org/D107861#2968305>, @MaskRay wrote:
>
>> In D107861#2968300 <https://reviews.llvm.org/D107861#2968300>, @jrtc27 wrote:
>>
>>> I'm concerned that this will turn ELFOSABI_FREEBSD objects into ELFOSABI_GNU ones, which can sometimes break things. This GNU extension is implemented by FreeBSD too so we shouldn't be forcing ELFOSABI_GNU, just avoiding ELFOSABI_NONE, and giving an error if you have a different ELFOSABI that doesn't support these things.
>>
>> This is not an issue. `llvm-mc -triple=x86_64-freebsd` sets ELFOSABI_FREEBSD. This overrides the implicit ELFOSABI_GNU.
>>
>> On FreeBSD, the default triple is set to *-freebsd.
>
> Ah I managed to gloss over the `OSABI == ELF::ELFOSABI_NONE` check when looking at the sole user of seenGnuAbi. In which case I see no problem with this from a FreeBSD perspective, the only thing I can think of is we silently allow these GNU/FreeBSD extensions for other OSABIs, not that I personally care about any of them.

"the only thing I can think of is we silently allow these GNU/FreeBSD extensions for other OSABIs, not that I personally care about any of them" is exactly my thought with STT_GNU_IFUNC.
It has been adopted by sufficiently more OSABIs that I am undecided what to do.

STB_GNU_UNIQUE is easy: Clang never emits `@gnu_unique_object`. It may be considered useless by many OSABIs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107861



More information about the llvm-commits mailing list