summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-02-12 17:46:49 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-02-12 17:46:49 +0000
commit203c5b9f39cbd9bc4ab3538537b36614af3274a8 (patch)
tree7e779fd92118a64ff6db03ab2236e75148c95b91 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parente732052f1661e9760827c18093169cf137c89850 (diff)
downloadbcm5719-llvm-203c5b9f39cbd9bc4ab3538537b36614af3274a8.tar.gz
bcm5719-llvm-203c5b9f39cbd9bc4ab3538537b36614af3274a8.zip
On ELF, put PIC jump tables in a non executable section.
Fixes PR22558. llvm-svn: 228939
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0a49f5ff9fe..4f46e37d39c 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -356,6 +356,13 @@ const MCSection *TargetLoweringObjectFileELF::getSectionForJumpTable(
return getContext().getELFSection(Name, ELF::SHT_PROGBITS, Flags, 0, Group);
}
+bool TargetLoweringObjectFileELF::shouldPutJumpTableInFunctionSection(
+ bool UsesLabelDifference, const Function &F) const {
+ // We can always create relative relocations, so use another section
+ // that can be marked non-executable.
+ return false;
+}
+
/// getSectionForConstant - Given a mergeable constant with the
/// specified size and relocation information, return a section that it
/// should be placed in.
OpenPOWER on IntegriCloud