forked from OSchip/llvm-project
Fix global version handling.
We should not ignore the symbol, just the version. Fixes error with -z defs. llvm-svn: 272270
This commit is contained in:
parent
1aa20e9b4c
commit
d2454d66e3
|
|
@ -529,11 +529,13 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
|
||||||
|
|
||||||
if (Versym) {
|
if (Versym) {
|
||||||
// Ignore local symbols and non-default versions.
|
// Ignore local symbols and non-default versions.
|
||||||
if (VersymIndex == VER_NDX_LOCAL || VersymIndex == VER_NDX_GLOBAL ||
|
if (VersymIndex == VER_NDX_LOCAL || (VersymIndex & VERSYM_HIDDEN))
|
||||||
(VersymIndex & VERSYM_HIDDEN))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
elf::Symtab<ELFT>::X->addShared(this, Name, Sym, Verdefs[VersymIndex]);
|
|
||||||
|
const Elf_Verdef *V =
|
||||||
|
VersymIndex == VER_NDX_GLOBAL ? nullptr : Verdefs[VersymIndex];
|
||||||
|
elf::Symtab<ELFT>::X->addShared(this, Name, Sym, V);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// REQUIRES: x86
|
// REQUIRES: x86
|
||||||
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
|
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
|
||||||
// RUN: ld.lld %t.o %p/Inputs/version-use.so -o %t.so -shared
|
// RUN: ld.lld %t.o %p/Inputs/version-use.so -o %t.so -shared -z defs
|
||||||
// RUN: llvm-readobj -s %t.so | FileCheck %s
|
// RUN: llvm-readobj -s %t.so | FileCheck %s
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue