https://bugs.llvm.org/show_bug.cgi?id=35987
Bug ID: 35987
Summary: Error when using linker scripts with ADDR and section
names with '-'
Product: lld
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: ELF
Assignee: unassignedb...@nondot.org
Reporter: roy...@freebsd.org
CC: llvm-bugs@lists.llvm.org
Hello,
I have the following sample linker script, it's basically an extract of a much
bigger linker file
---
SECTIONS
{
.note.gnu.build-id : AT(ADDR(.note.gnu.build-id)) {
*(.note.gnu.build-id)
} :text
}
---
Which I try to use with lld, giving the following error:
$ ld --build-id=sha1 -T test.lds
ld: error: test.lds:3: ) expected, but got -
ld: error: test.lds:3: .note.gnu.build-id : AT(ADDR(.note.gnu.build-id)) {
ld: error: test.lds:3: ^
ld: error: target emulation unknown: -m or at least one .o file required
Ignoring the error about the lack of input files or emulation, it seems like
ADDR somehow checks that the parameter of ADDR is not an expression, but fails
to realise that sections can have '-' in their names.
The output with GNU ld is:
$ ld --build-id=sha1 -T test.lds
/usr/local/bin/ld: no input files
And I can confirm using ADDR(.note.gnu.build-id) with GNU ld works fine.
Thanks, Roger.
--
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