diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-12 00:38:17 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-12 00:38:17 +0000 |
commit | a5f1d57f65ae601ec181c0f4e36cf0df5e8d79d8 (patch) | |
tree | 99cbdd963a1c49327eda3dd44b4ee76b3d797bd9 /lib/MC/MCAssembler.cpp | |
parent | 85f4fdaed4fcc6050499579152c45fde679213d3 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 65e3571107..8ec927e415 100644 --- a/lib/MC/MCAssembler.cpp +++ b/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(); } |