[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Atanasyan
2014-11-25 05:57:55 +00:00
parent 453ce91dbc
commit c5e9bf54c7
3 changed files with 15 additions and 2 deletions

View File

@ -280,8 +280,9 @@ std::error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
const Elf_Ehdr *Header = EF.getHeader();
Result = ESym->st_value;
// Clear the ARM/Thumb indicator flag.
if (Header->e_machine == ELF::EM_ARM && ESym->getType() == ELF::STT_FUNC)
// Clear the ARM/Thumb or microMIPS indicator flag.
if ((Header->e_machine == ELF::EM_ARM || Header->e_machine == ELF::EM_MIPS) &&
ESym->getType() == ELF::STT_FUNC)
Result &= ~1;
if (Header->e_type == ELF::ET_REL)