summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp4
-rw-r--r--llvm/test/CodeGen/X86/eh_frame.ll5
2 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index cb337d84dba..ff88b6f2e99 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -255,7 +255,7 @@ getELFKindForNamedSection(StringRef Name, SectionKind K) {
return SectionKind::getThreadBSS();
if (Name == ".eh_frame")
- return SectionKind::getDataRel();
+ return SectionKind::getReadOnlyWithRel();
return K;
}
@@ -289,7 +289,7 @@ getELFSectionFlags(SectionKind K) {
if (K.isText())
Flags |= ELF::SHF_EXECINSTR;
- if (K.isWriteable())
+ if (K.isWriteable() && !K.isReadOnlyWithRel())
Flags |= ELF::SHF_WRITE;
if (K.isThreadLocal())
diff --git a/llvm/test/CodeGen/X86/eh_frame.ll b/llvm/test/CodeGen/X86/eh_frame.ll
new file mode 100644
index 00000000000..e8d3c87d41b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/eh_frame.ll
@@ -0,0 +1,5 @@
+; RUN: llc < %s -mtriple x86_64-unknown-linux-gnu | FileCheck %s
+
+@__FRAME_END__ = constant [1 x i32] zeroinitializer, section ".eh_frame"
+
+; CHECK: .section .eh_frame,"a",@progbits
OpenPOWER on IntegriCloud