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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131951 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index cb337d8..ff88b6f 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -255,7 +255,7 @@
     return SectionKind::getThreadBSS();
 
   if (Name == ".eh_frame")
-    return SectionKind::getDataRel();
+    return SectionKind::getReadOnlyWithRel();
 
   return K;
 }
@@ -289,7 +289,7 @@
   if (K.isText())
     Flags |= ELF::SHF_EXECINSTR;
 
-  if (K.isWriteable())
+  if (K.isWriteable() && !K.isReadOnlyWithRel())
     Flags |= ELF::SHF_WRITE;
 
   if (K.isThreadLocal())