[ELF] --sysroot: change sysrooted script to not fall back for an absolute path
authorFangrui Song <i@maskray.me>
Fri, 25 Jun 2021 19:52:39 +0000 (12:52 -0700)
committerFangrui Song <i@maskray.me>
Fri, 25 Jun 2021 19:52:39 +0000 (12:52 -0700)
commit2508733e1be28da8c53d36c109007b778225ec7a
tree96ae1c11e2c4ea8df13bfa759e8b225c43d71ed3
parentb2674670f264e2a80c79cb8bf2186f1ab3b791e6
[ELF] --sysroot: change sysrooted script to not fall back for an absolute path

Modify the D13209 logic: for a script inside the sysroot, if an absolute path
does not exist, report an error instead of falling back to the path without the
sysroot prefix.

This matches GNU ld, which makes sense to me: we don't want to find an arbitrary
file in the host.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D104894
lld/ELF/ScriptParser.cpp
lld/test/ELF/linkerscript/group.s