[PATCH] D17956: Set the thumb flag for thumb symbols coming from an ELF file

Tamas Berghammer via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 03:59:24 PST 2016


tberghammer created this revision.
tberghammer added reviewers: rengolin, rafael.
tberghammer added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.

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.

http://reviews.llvm.org/D17956

Files:
  include/llvm/Object/ELFObjectFile.h

Index: include/llvm/Object/ELFObjectFile.h
===================================================================
--- include/llvm/Object/ELFObjectFile.h
+++ include/llvm/Object/ELFObjectFile.h
@@ -493,6 +493,8 @@
           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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17956.50035.patch
Type: text/x-patch
Size: 459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160308/0e69bd69/attachment.bin>


More information about the llvm-commits mailing list