summaryrefslogtreecommitdiff
path: root/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
commitc3c5d7c2d6e3add269d590b2632dec48634d39cf (patch)
tree89a37d312cd7bd89a7399d0cecb8d3fe887f8733 /lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent8eeedf74d346d6797236544847ebaa45e14d7703 (diff)
On ELF, put PIC jump tables in a non executable section.
Fixes PR22558. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0a49f5ff9fe..4f46e37d39c 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/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.