summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-05-13 20:52:30 +0000
committerLang Hames <lhames@gmail.com>2019-05-13 20:52:30 +0000
commit56baade10dcf43855faf577554e1810873793da5 (patch)
treec31823e7c3fd703d800f114359564b0b7709107d /llvm/lib/ExecutionEngine
parent3cce23746edfc6c24f25b73bd8032582df03222c (diff)
downloadbcm5719-llvm-56baade10dcf43855faf577554e1810873793da5.tar.gz
bcm5719-llvm-56baade10dcf43855faf577554e1810873793da5.zip
[JITLink][MachO] Honor the no-dead-strip flag on nlist entries.
llvm-svn: 360618
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp b/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp
index b24b2256826..062bbda6f2a 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp
@@ -252,15 +252,22 @@ Error MachOAtomGraphBuilder::addNonCustomAtoms() {
DA.setCallable(*SymType & object::SymbolRef::ST_Function);
- // Check alt-entry.
+ // Check NDesc flags.
{
uint16_t NDesc = 0;
if (Obj.is64Bit())
NDesc = Obj.getSymbolTableEntry(SymI->getRawDataRefImpl()).n_desc;
else
NDesc = Obj.getSymbolTableEntry(SymI->getRawDataRefImpl()).n_desc;
+
+ // Record atom for alt-entry post-processing (where the layout-next
+ // constraints will be added).
if (NDesc & MachO::N_ALT_ENTRY)
AltEntryAtoms.push_back(&DA);
+
+ // If this atom has a no-dead-strip attr attached then mark it live.
+ if (NDesc & MachO::N_NO_DEAD_STRIP)
+ DA.setLive(true);
}
LLVM_DEBUG({
OpenPOWER on IntegriCloud