<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - option --no-rosegment always group RO with X sections."
   href="https://bugs.llvm.org/show_bug.cgi?id=38784">38784</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>option --no-rosegment always group RO with X sections.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pshung807@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Take the following use case as an example.

# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: echo "SECTIONS { \
# RUN: .text : { *(.text) } \
# RUN: . = 0x200000;  \
# RUN: .rodata : { *(.rodata) } \
# RUN: }" > %t.script
# RUN: ld.lld --no-rosegment -o %t -T %t.script %t.o
# RUN: llvm-readelf -S %t | FileCheck %s

.text
nop
.rodata
        .word 0x41
        .word 0x42
        .word 0x43
        .word 0x44

----------------------------------------------------------------------

LLD --always groups RO section with X sections.
This decision generates a huge binary for the above case.
lld: put rodata and text into one segment, Binary size: 2.1M
bfd: put rodata and text into separate segments, Binary size: 8.7k


BTW, --no-rosegment seems to be removed by bfd linker. (my version is ld-2.31.)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>