mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
[elf2] Add STB_GNU_UNIQUE support.
llvm-svn: 249193
This commit is contained in:
@@ -181,6 +181,7 @@ SymbolBody *elf2::ObjectFile<ELFT>::createSymbolBody(StringRef StringTable,
|
||||
error("unexpected binding");
|
||||
case STB_GLOBAL:
|
||||
case STB_WEAK:
|
||||
case STB_GNU_UNIQUE:
|
||||
return new (Alloc) DefinedRegular<ELFT>(Name, *Sym, *Sections[SecIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
24
lld/test/elf2/gnu-unique.s
Normal file
24
lld/test/elf2/gnu-unique.s
Normal file
@@ -0,0 +1,24 @@
|
||||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
||||
// RUN: lld -flavor gnu2 %t -shared -o %tout.so
|
||||
// RUN: llvm-readobj -t -dyn-symbols %tout.so | FileCheck %s
|
||||
// REQUIRES: x86
|
||||
|
||||
// Check that STB_GNU_UNIQUE is treated as a global and ends up in the dynamic
|
||||
// symbol table as STB_GNU_UNIQUE.
|
||||
|
||||
.global _start
|
||||
.text
|
||||
_start:
|
||||
|
||||
.data
|
||||
.type symb, @gnu_unique_object
|
||||
symb:
|
||||
|
||||
# CHECK: Name: symb@
|
||||
# CHECK-NEXT: Value:
|
||||
# CHECK-NEXT: Size: 0
|
||||
# CHECK-NEXT: Binding: Unique
|
||||
# CHECK-NEXT: Type: Object
|
||||
# CHECK-NEXT: Other: 0
|
||||
# CHECK-NEXT: Section: .data
|
||||
# CHECK-NEXT: }
|
||||
Reference in New Issue
Block a user