GCC when configured with --enable-gnu-unique (default on glibc>=2.11)
emits STB_GNU_UNIQUE for certain objects which are otherwise emitted as
STT_OBJECT, such as an inline function's static local variable or its
guard variable, and a static data member of a template.
Clang does not implement -fgnu-unique.
Implementing it as a binding is strange and the feature itself is
considered by some as a misfeature.
Reviewed By: grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D75797
# CHECK-NEXT:0000000000000000 *UND* 0000000000000000 reserve
# CHECK-NEXT:0000000000000000 g *ABS* 0000000000000000 abs
# CHECK-NEXT:0000000000000000 *COM* 0000000000000000 common2
-# CHECK-NEXT:0000000000000000 g O .data 0000000000000000 gnu_unique
+# CHECK-NEXT:0000000000000000 u O .data 0000000000000000 gnu_unique
# CHECK-NEXT:0000000000000000 g .data 0000000000000000 invalid_binding
# CHECK-NEXT:0000000000000000 g .data 0000000000000000 STB_HIOS
# CHECK-NEXT:0000000000000000 g .data 0000000000000000 STB_LOPROC
if (auto *ELF = dyn_cast<ELFObjectFileBase>(O)) {
if (ELFSymbolRef(*I).getELFType() == ELF::STT_GNU_IFUNC)
IFunc = 'i';
+ if (ELFSymbolRef(*I).getBinding() == ELF::STB_GNU_UNIQUE)
+ GlobLoc = 'u';
}
char Debug = (Type == SymbolRef::ST_Debug || Type == SymbolRef::ST_File)
? 'd' : ' ';