https://bugs.llvm.org/show_bug.cgi?id=38625
Bug ID: 38625
Summary: linker script parser rejects INFO output section type
when used with a start address
Product: lld
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedb...@nondot.org
Reporter: d...@djc.id.au
CC: llvm-bugs@lists.llvm.org
Lld supports INFO as an output section type, similar to NOLOAD. See:
https://bugs.llvm.org/show_bug.cgi?id=36298
https://sourceware.org/binutils/docs/ld/Output-Section-Type.html#Output-Section-Type
However it only accepts the (INFO) type when no start address is present. That
is, it rejects this:
.stack _edata (INFO) :
{
with this error:
lld: error: link.x:32: NOLOAD expected, but got INFO
>>> .stack _edata (INFO) :
>>> ^
whereas it accepts the same without a specific start address:
.stack (INFO) :
{
Here is a more complete and somewhat realistic reproducer:
$ cat test.c
void _start(void) {
}
$ gcc -nostdlib -nostartfiles -c test.c
$ cat link.x
MEMORY
{
FLASH : ORIGIN = 0x20400000, LENGTH = 512M
RAM : ORIGIN = 0x80000000, LENGTH = 16K
}
SECTIONS
{
.text :
{
*(.text);
} > FLASH
.rodata :
{
*(.rodata);
} > FLASH
.bss :
{
*(.bss);
} > RAM
.data : AT(LOADADDR(.rodata) + SIZEOF(.rodata))
{
_sdata = .;
*(.data);
. = ALIGN(4);
_edata = .;
} > RAM
PROVIDE(_stack_start = ORIGIN(RAM) + LENGTH(RAM));
.stack _edata (INFO) :
{
_estack = .;
. = _stack_start;
_sstack = .;
} > RAM
/DISCARD/ :
{
*(.eh_frame);
}
}
$ lld -flavor gnu -Tlink.x -o test test.o
lld: error: link.x:32: NOLOAD expected, but got INFO
>>> .stack _edata (INFO) :
>>> ^
--
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