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: unassignedb...@nondot.org
Reporter: jh7370.2...@my.bristol.ac.uk
CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs