mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-01 13:20:25 +00:00
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) {
|
||||
// Ignore local symbols and non-default versions.
|
||||
if (VersymIndex == VER_NDX_LOCAL || VersymIndex == VER_NDX_GLOBAL ||
|
||||
(VersymIndex & VERSYM_HIDDEN))
|
||||
if (VersymIndex == VER_NDX_LOCAL || (VersymIndex & VERSYM_HIDDEN))
|
||||
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
|
||||
// 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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user