<html>
    <head>
      <base href="http://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 - Linker Script: sections with no inputs should not be SHT_NOBITS"
   href="http://bugs.llvm.org/show_bug.cgi?id=32537">32537</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Linker Script: sections with no inputs should not be SHT_NOBITS
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>jh7370.2008@my.bristol.ac.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If a linker script defines a section which uses the BYTE() or similar command,
or assigns to ".", LLD assigns it a type of SHT_NOBITS. This is incorrect,
because the section actually contains data, and takes up space in the file.

Example script:
SECTIONS {
    .section : { FILL(0x22222222); . += 4; BYTE(0x11); . += 4; }
}

The section contents are written to disk as:
222222221122222222

but llvm-objdump skips the section because of its type and I would expect the
loader to ignore the contents when loading the file.

The type should probably be SHT_PROGBITS by default.</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>