summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
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/Target
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/Target')
-rw-r--r--llvm/lib/Target/X86/X86AsmBackend.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86AsmBackend.cpp b/llvm/lib/Target/X86/X86AsmBackend.cpp
index b72601ae586..8ee836e1c61 100644
--- a/llvm/lib/Target/X86/X86AsmBackend.cpp
+++ b/llvm/lib/Target/X86/X86AsmBackend.cpp
@@ -259,6 +259,26 @@ public:
const MCSectionMachO &SMO = static_cast<const MCSectionMachO&>(Section);
return SMO.getType() == MCSectionMachO::S_CSTRING_LITERALS;
}
+
+ virtual bool isSectionAtomizable(const MCSection &Section) const {
+ const MCSectionMachO &SMO = static_cast<const MCSectionMachO&>(Section);
+ // Fixed sized data sections are uniqued, they cannot be diced into atoms.
+ switch (SMO.getType()) {
+ default:
+ return true;
+
+ case MCSectionMachO::S_4BYTE_LITERALS:
+ case MCSectionMachO::S_8BYTE_LITERALS:
+ case MCSectionMachO::S_16BYTE_LITERALS:
+ case MCSectionMachO::S_LITERAL_POINTERS:
+ case MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS:
+ case MCSectionMachO::S_LAZY_SYMBOL_POINTERS:
+ case MCSectionMachO::S_MOD_INIT_FUNC_POINTERS:
+ case MCSectionMachO::S_MOD_TERM_FUNC_POINTERS:
+ case MCSectionMachO::S_INTERPOSING:
+ return false;
+ }
+ }
};
}
OpenPOWER on IntegriCloud