[lld] [lld][ELF] Enable link script to support absolute path matching (PR #156353)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 08:32:12 PDT 2025
smithp35 wrote:
I think a modification of the file pattern to include the path separator would exclude files that have a prefix.
```
#--- script_star.ld
SECTIONS {
.text : { *(.text) }
.goo : {
*/bar.o(.text_bar);
*/foo.o(.text_foo);
}
}
```
As a reviewer I'm reluctant to accept any change to linker scripts that isn't bringing us closer to the documented GNU ld behaviour in https://sourceware.org/binutils/docs/ld/Input-Section.html . Can you check your linker script on GNU ld to see how lld compares to GNU ld?
If GNU ld and lld behave the same way then sorry I don't think this is the right change to make without getting an equivalent change into GNU ld.
https://github.com/llvm/llvm-project/pull/156353
More information about the llvm-commits
mailing list