PR 6048
[binutils-gdb.git] / gold / script-sections.cc
index 4891ac7d93c245b633ed898c51ecf76a4b1c4d2d..13c97710d29d8a187ad6b92493a931985b8531c4 100644 (file)
@@ -2657,7 +2657,8 @@ Script_sections::create_segments(Layout* layout)
          need_new_segment = true;
        }
       else if (is_current_seg_readonly
-              && ((*p)->flags() & elfcpp::SHF_WRITE) != 0)
+              && ((*p)->flags() & elfcpp::SHF_WRITE) != 0
+              && !parameters->options().omagic())
        {
          // Don't put a writable section in the same segment as a
          // non-writable section.