MC: Treat ReadOnlyWithRel and ReadOnlyWithRelLocal as ReadOnly for COFF
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 20 Sep 2014 07:31:46 +0000 (07:31 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 20 Sep 2014 07:31:46 +0000 (07:31 +0000)
commit3f34ae97b90c0d9373f3ad2be3f769d8ea206302
tree08f36fe64be0e160e57b49ef346960307af8d29f
parentc16105b078a09cbf377c637a5e7e6573ddb58593
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
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/MC/MCSectionCOFF.cpp
test/MC/COFF/const-gv-with-rel-init.ll [new file with mode: 0644]