diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-09-20 07:31:46 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-09-20 07:31:46 +0000 |
commit | b8dbebb31c5d191e766e5e4bc6ea5b19b9bec0d5 (patch) | |
tree | b0b59674ea1929007933c791311164a6fba85b6f /llvm/lib/MC/MCSectionCOFF.cpp | |
parent | 8c4cccd4aae0d385ccc86b46f0810bb5fa4c1d6b (diff) | |
download | bcm5719-llvm-b8dbebb31c5d191e766e5e4bc6ea5b19b9bec0d5.tar.gz bcm5719-llvm-b8dbebb31c5d191e766e5e4bc6ea5b19b9bec0d5.zip |
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.
llvm-svn: 218179
Diffstat (limited to 'llvm/lib/MC/MCSectionCOFF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSectionCOFF.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCSectionCOFF.cpp b/llvm/lib/MC/MCSectionCOFF.cpp index fc2bd365e16..ee6b249522b 100644 --- a/llvm/lib/MC/MCSectionCOFF.cpp +++ b/llvm/lib/MC/MCSectionCOFF.cpp @@ -51,7 +51,7 @@ void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, OS << 'x'; else if (getKind().isBSS()) OS << 'b'; - if (getKind().isWriteable()) + if (getKind().isWriteable() && !getKind().isReadOnlyWithRel()) OS << 'w'; else OS << 'r'; |