forked from OSchip/llvm-project
parent
defdfa86c1
commit
361da4cef7
|
@ -622,11 +622,11 @@ std::vector<SymbolBody *> SymbolTable<ELFT>::findAll(SymbolVersion Ver) {
|
|||
template <class ELFT> void SymbolTable<ELFT>::handleAnonymousVersion() {
|
||||
for (SymbolVersion &Ver : Config->VersionScriptGlobals) {
|
||||
if (Ver.HasWildcard) {
|
||||
for (SymbolBody *B : findAll(Ver.Name))
|
||||
for (SymbolBody *B : findAll(Ver))
|
||||
B->symbol()->VersionId = VER_NDX_GLOBAL;
|
||||
continue;
|
||||
}
|
||||
if (SymbolBody *B = find(Ver.Name))
|
||||
for (SymbolBody *B : find(Ver))
|
||||
B->symbol()->VersionId = VER_NDX_GLOBAL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
# REQUIRES: x86
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
# RUN: echo '{ \
|
||||
# RUN: global: \
|
||||
# RUN: _Z3bari; \
|
||||
# RUN: extern "C++" { \
|
||||
# RUN: "foo(int)"; \
|
||||
# RUN: z*; \
|
||||
# RUN: }; \
|
||||
# RUN: local: *; \
|
||||
# RUN: }; ' > %t.script
|
||||
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
|
||||
# RUN: llvm-readobj -dyn-symbols %t.so | FileCheck %s
|
||||
|
||||
# CHECK: DynamicSymbols [
|
||||
# CHECK-NEXT: Symbol {
|
||||
# CHECK-NEXT: Name:
|
||||
# CHECK-NEXT: Value:
|
||||
# CHECK-NEXT: Size:
|
||||
# CHECK-NEXT: Binding: Local
|
||||
# CHECK-NEXT: Type:
|
||||
# CHECK-NEXT: Other:
|
||||
# CHECK-NEXT: Section:
|
||||
# CHECK-NEXT: }
|
||||
# CHECK-NEXT: Symbol {
|
||||
# CHECK-NEXT: Name: _Z3bari
|
||||
# CHECK-NEXT: Value:
|
||||
# CHECK-NEXT: Size:
|
||||
# CHECK-NEXT: Binding: Global
|
||||
# CHECK-NEXT: Type:
|
||||
# CHECK-NEXT: Other:
|
||||
# CHECK-NEXT: Section:
|
||||
# CHECK-NEXT: }
|
||||
# CHECK-NEXT: Symbol {
|
||||
# CHECK-NEXT: Name: _Z3fooi
|
||||
# CHECK-NEXT: Value:
|
||||
# CHECK-NEXT: Size:
|
||||
# CHECK-NEXT: Binding: Global
|
||||
# CHECK-NEXT: Type:
|
||||
# CHECK-NEXT: Other:
|
||||
# CHECK-NEXT: Section:
|
||||
# CHECK-NEXT: }
|
||||
# CHECK-NEXT: Symbol {
|
||||
# CHECK-NEXT: Name: _Z3zedi
|
||||
# CHECK-NEXT: Value:
|
||||
# CHECK-NEXT: Size:
|
||||
# CHECK-NEXT: Binding: Global
|
||||
# CHECK-NEXT: Type:
|
||||
# CHECK-NEXT: Other:
|
||||
# CHECK-NEXT: Section:
|
||||
# CHECK-NEXT: }
|
||||
# CHECK-NEXT: ]
|
||||
|
||||
.global _Z3fooi
|
||||
_Z3fooi:
|
||||
.global _Z3bari
|
||||
_Z3bari:
|
||||
.global _Z3zedi
|
||||
_Z3zedi:
|
||||
.global _Z3bazi
|
||||
_Z3bazi:
|
Loading…
Reference in New Issue