[llvm-bugs] [Bug 34886] New: SUBALIGN should not support expressions involving '.'

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 9 08:18:19 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34886

            Bug ID: 34886
           Summary: SUBALIGN should not support expressions involving '.'
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: llvm-bugs at lists.llvm.org

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 https://reviews.llvm.org/D38360 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171009/9a9d0b64/attachment.html>


More information about the llvm-bugs mailing list