<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 - SUBALIGN should not support expressions involving '.'"
   href="https://bugs.llvm.org/show_bug.cgi?id=34886">34886</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SUBALIGN should not support expressions involving '.'
          </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>LLD currently allows any arbitrary expression in the SUBALIGN linker script
directive. However, such expressions can end up being relative to '.'. The
code, however, does not update '.' at all before the SUBALIGN expression is
evaluated. This results in SUBALIGN taking a value of zero, currently, and thus
an assertion failure when attempting to process the alignment. The following
example linker script will illustrate this failure.

SECTIONS
{
    . = 32;
    .text : SUBALIGN(.) { *(.text*) }
}

Note that if <a href="https://reviews.llvm.org/D38360">https://reviews.llvm.org/D38360</a> should land in its current state,
then different errors will occur in this case, rather than the divide by zero
issue.

For reference, ld.bfd refuses to accept non-constant expressions in this case,
while gold accepts them, but produces an internal error.</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>