[MC] Change ELFOSABI_NONE to ELFOSABI_GNU for STB_GNU_UNIQUE
authorFangrui Song <i@maskray.me>
Fri, 27 Aug 2021 15:53:55 +0000 (08:53 -0700)
committerFangrui Song <i@maskray.me>
Fri, 27 Aug 2021 15:53:55 +0000 (08:53 -0700)
commit83dfa0d098f3176607aecea815eb87979953cdb5
tree1a129e82581f2e4bc591db273a8edde1d7f2ff7c
parent77b6a4bde4de37bd77f4846b3c31c1d0633a8f13
[MC] Change ELFOSABI_NONE to ELFOSABI_GNU for STB_GNU_UNIQUE

Similar to D97976.
On Linux, most GCC installations are configured with
`--enable-gnu-unique-object` and such GCC emits `@gnu_unique_object` assembly.

The feature is highly controversial and disliked by many folks.
(On glibc DF_1_NODELETE is implicitly enabled and makes dlclose a no-op).

In llvm-project STB_GNU_UNIQUE is assembly only. Clang does not use STB_GNU_UNIQUE.

Use ELFOSABI_GNU to match GNU as behavior and avoid collision with other
OSABI binding values.

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D107861
llvm/lib/MC/MCELFStreamer.cpp
llvm/test/MC/ELF/gnu-type.s
llvm/test/MC/ELF/gnu-unique.s [new file with mode: 0644]