diff options
author | Tamas Berghammer <tberghammer@google.com> | 2016-04-05 12:11:40 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2016-04-05 12:11:40 +0000 |
commit | 849045f2aaa5302f931b4fea3448d7af76e6b4f0 (patch) | |
tree | 317855ac26ea49d241f1bfd53d9c68afe0c5c343 /llvm | |
parent | d9a1717efc2e4d17661d4d2b8f8306421213605b (diff) | |
download | bcm5719-llvm-849045f2aaa5302f931b4fea3448d7af76e6b4f0.tar.gz bcm5719-llvm-849045f2aaa5302f931b4fea3448d7af76e6b4f0.zip |
Set the thumb flag for thumb symbols coming from an ELF file
Without setting the flag there is no way to determine if a symbol
points to an arm or to a thumb function as the LSB of the address
masked out in all getter function.
Note: Currently the thumb flag is only used for MachO files so
adding a test to this change is not possible. It will be used
by the upcoming fix for llvm-objdump for disassembling thumb
functions what is easily testable.
Differential revision: http://reviews.llvm.org/D17956
llvm-svn: 265387
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Object/ELFObjectFile.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h index 5acb4ae3f4e..e84d348ce58 100644 --- a/llvm/include/llvm/Object/ELFObjectFile.h +++ b/llvm/include/llvm/Object/ELFObjectFile.h @@ -494,6 +494,8 @@ uint32_t ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const { Name.startswith("$a")) Result |= SymbolRef::SF_FormatSpecific; } + if (ESym->getType() == ELF::STT_FUNC && (ESym->st_value & 1) == 1) + Result |= SymbolRef::SF_Thumb; } if (ESym->st_shndx == ELF::SHN_UNDEF) |