summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-12 00:38:17 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-12 00:38:17 +0000
commitba2f4c3884d999904143e755ffa0f05ca2b532c4 (patch)
tree07244343f759aa3d062d3796198eabccb213a0b4 /llvm/lib/MC/MCAssembler.cpp
parente6e39dc31068f8bbec75eff75b65ddf64782df37 (diff)
downloadbcm5719-llvm-ba2f4c3884d999904143e755ffa0f05ca2b532c4.tar.gz
bcm5719-llvm-ba2f4c3884d999904143e755ffa0f05ca2b532c4.zip
MC/Mach-O/x86_64: Add a new hook for checking whether a particular section can
be diced into atoms, and adjust getAtom() to take this into account. - This fixes relocations to symbols in fixed size literal sections, for example. llvm-svn: 103532
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 65e3571107b..8ec927e4150 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -297,6 +297,12 @@ const MCSymbolData *MCAssembler::getAtom(const MCAsmLayout &Layout,
if (!SD->getFragment())
return 0;
+ // Non-linker visible symbols in sections which can't be atomized have no
+ // defining atom.
+ if (!getBackend().isSectionAtomizable(
+ SD->getFragment()->getParent()->getSection()))
+ return 0;
+
// Otherwise, return the atom for the containing fragment.
return SD->getFragment()->getAtom();
}
OpenPOWER on IntegriCloud