Fix the defaults for .eh_frame. We were marking it as writable.

llvm-svn: 131951
This commit is contained in:
Rafael Espindola 2011-05-24 02:50:20 +00:00
parent a8032e96b5
commit 0f33be1b87
2 changed files with 7 additions and 2 deletions

View File

@ -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())

View File

@ -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