mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
MC: Treat ReadOnlyWithRel and ReadOnlyWithRelLocal as ReadOnly for COFF
A problem with our old behavior becomes observable under x86-64 COFF when we need a read-only GV which has an initializer which is referenced using a relocation: we would mark the section as writable. Marking the section as writable interferes with section merging. This fixes PR21009. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218179 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -761,7 +761,7 @@ getCOFFSectionFlags(SectionKind K) {
|
||||
COFF::IMAGE_SCN_MEM_EXECUTE |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_CNT_CODE;
|
||||
else if (K.isBSS ())
|
||||
else if (K.isBSS())
|
||||
Flags |=
|
||||
COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
@@ -771,7 +771,7 @@ getCOFFSectionFlags(SectionKind K) {
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ |
|
||||
COFF::IMAGE_SCN_MEM_WRITE;
|
||||
else if (K.isReadOnly())
|
||||
else if (K.isReadOnly() || K.isReadOnlyWithRel())
|
||||
Flags |=
|
||||
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||
COFF::IMAGE_SCN_MEM_READ;
|
||||
|
||||
Reference in New Issue
Block a user