https://bugs.llvm.org/show_bug.cgi?id=38040
Bug ID: 38040
Summary: DEFINED doesn't work with the conditional operator
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,
The following construct:
foo = DEFINED(foo) ? foo : .;
Doesn't work with ld:
ld: error: script.lds:2: symbol not found: foo
This is one of the usages of the DEFINED builtin functions from the GNU ld
manual at:
https://sourceware.org/binutils/docs/ld/Builtin-Functions.html
Here are the steps in order to reproduce:
$ cat script.lds
SECTIONS {
foo = DEFINED(foo) ? foo : .;
}
$ touch foo.c
$ cc -c foo.c -o foo.o
$ ld -T script.lds foo.o
ld: error: script.lds:2: symbol not found: foo
--
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