<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 - LLVM's ld.lld doesn't support expressions in linker script for section's filling"
   href="https://bugs.llvm.org/show_bug.cgi?id=42482">42482</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM's ld.lld doesn't support expressions in linker script for section's filling
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This document
<a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html#OUTPUT-SECTION-FILL">https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html#OUTPUT-SECTION-FILL</a>
states, that it is possible to fill section by expression.

It is not possible using lld.

Example:
- funnyos.lds.S:
```
#define FILL_EXPR                       \
        (((INFINITE_LOOP_OPCODE >> 24) & 0xFF) |        \
        ((INFINITE_LOOP_OPCODE << 8) & 0xFF0000) |      \
        ((INFINITE_LOOP_OPCODE >> 8) & 0xFF00) |        \
        ((INFINITE_LOOP_OPCODE << 24) & 0xFF000000))

...

SECTIONS
{
...
        .init ALIGN(PAGE_SIZE) : {
                _sinit_text = .;
                ...
                *(.init.text)
                _einit_text = .;
        } = FILL_EXPR
...
}
```

P.S. Binutil's linker can do this.</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>