summaryrefslogtreecommitdiff
path: root/lib/Object/ModuleSymbolTable.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-12-01 06:53:47 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-12-01 06:53:47 +0000
commit71fc8a346a2ff86ec254eb5b025c1b5c98565c8a (patch)
treeee12068446dfee4baddab0096e4bf22446811e5c /lib/Object/ModuleSymbolTable.cpp
parentdc61d3e913cdb087fdc2bf4d6cab883b2d83afa0 (diff)
downloadllvm-71fc8a346a2ff86ec254eb5b025c1b5c98565c8a.tar.gz
Object: Add SF_Executable symbol flag.
This allows us to remove a few uses of IRObjectFile::getSymbolGV() in llvm-nm. While here change host-dependent logic in llvm-nm to target-dependent logic. Differential Revision: https://reviews.llvm.org/D27075 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/ModuleSymbolTable.cpp')
-rw-r--r--lib/Object/ModuleSymbolTable.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Object/ModuleSymbolTable.cpp b/lib/Object/ModuleSymbolTable.cpp
index 5e534af44102..c8b1bb6b775f 100644
--- a/lib/Object/ModuleSymbolTable.cpp
+++ b/lib/Object/ModuleSymbolTable.cpp
@@ -109,7 +109,8 @@ void ModuleSymbolTable::CollectAsmSymbols(
for (auto &KV : Streamer) {
StringRef Key = KV.first();
RecordStreamer::State Value = KV.second;
- uint32_t Res = BasicSymbolRef::SF_None;
+ // FIXME: For now we just assume that all asm symbols are executable.
+ uint32_t Res = BasicSymbolRef::SF_Executable;
switch (Value) {
case RecordStreamer::NeverSeen:
llvm_unreachable("NeverSeen should have been replaced earlier");
@@ -163,6 +164,8 @@ uint32_t ModuleSymbolTable::getSymbolFlags(Symbol S) const {
if (GVar->isConstant())
Res |= BasicSymbolRef::SF_Const;
}
+ if (dyn_cast_or_null<Function>(GV->getBaseObject()))
+ Res |= BasicSymbolRef::SF_Executable;
if (GV->hasPrivateLinkage())
Res |= BasicSymbolRef::SF_FormatSpecific;
if (!GV->hasLocalLinkage())