mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
[ELF][MIPS] Ignore incorrect version definition index for _gp_disp symbol
MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero version definition index to it. This value means 'unversioned local symbol' while _gp_disp is a section global symbol. We have to handle this bug in the LLD because BFD linker is used for building MIPS toolchain libraries. Differential revision: https://reviews.llvm.org/D42486 llvm-svn: 324467
This commit is contained in:
@@ -862,6 +862,14 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Config->EMachine == EM_MIPS) {
|
||||
// FIXME: MIPS BFD linker puts _gp_disp symbol into DSO files
|
||||
// and incorrectly assigns VER_NDX_LOCAL to this section global
|
||||
// symbol. Here is a workaround for this bug.
|
||||
if (Versym && VersymIndex == VER_NDX_LOCAL && Name == "_gp_disp")
|
||||
continue;
|
||||
}
|
||||
|
||||
const Elf_Verdef *Ver = nullptr;
|
||||
if (VersymIndex != VER_NDX_GLOBAL) {
|
||||
if (VersymIndex >= Verdefs.size() || VersymIndex == VER_NDX_LOCAL) {
|
||||
|
||||
Reference in New Issue
Block a user