Issue 142927
Summary A error diagnostic for non-existent `PHDR` would be helpful
Labels new issue
Assignees
Reporter parth-07
    LLD allows to refer to non-existent `PHDR` when no `PHDRS` command is specified. It should be an error to do so.

Reproducible example:

```bash
#!/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
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to