[COFF] Don't mark mingw .eh_frame sections writable

This improves compatibility with GCC produced object files, where
the .eh_frame sections are read only. With mixed flags for the
involved .eh_frame sections, LLD creates two separate .eh_frame
sections in the output binary, one for each flag combination,
while ld.bfd probably merges them.

The previous setup of flags can be traced back to SVN r79346.

Differential Revision: https://reviews.llvm.org/D55209

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Martin Storsjo
2018-12-03 20:02:05 +00:00
parent 40c4646174
commit 53ce77a033
2 changed files with 17 additions and 4 deletions
+4 -4
View File
@@ -479,10 +479,10 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
}
void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
EHFrameSection = Ctx->getCOFFSection(
".eh_frame", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE,
SectionKind::getData());
EHFrameSection =
Ctx->getCOFFSection(".eh_frame", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
COFF::IMAGE_SCN_MEM_READ,
SectionKind::getData());
// Set the `IMAGE_SCN_MEM_16BIT` flag when compiling for thumb mode. This is
// used to indicate to the linker that the text segment contains thumb instructions