Open
Description
LLD allows to refer to non-existent PHDR
when no PHDRS
command is specified. It should be an error to do so.
Reproducible example:
#!/usr/bin/env bash
cat >1.c <<\EOF
int foo() { return 1; }
int var = 3;
EOF
cat >script.t <<\EOF
SECTIONS {
.text : { *(.text.*) } :C
.data : { *(.data.*) }
}
EOF
clang -o 1.o 1.c -c -ffunction-sections -fdata-sections
ld.lld -o 1.out 1.o -T script.t # No error/warning for non-existent PHDR C