eld does not expand = and $SYSROOT in INPUT and GROUP commands to sysroot.
Reproducer:
#!/usr/bin/env bash
mkdir -p A/lib64
mkdir -p A/script
cat >1.c <<\EOF
int foo() { return 1; }
EOF
cat >script.t <<\EOF
// or $SYSROOT instead of =
INPUT(=/lib64/lib1.so)
EOF
cat >main.c <<\EOF
int main() { return 0; }
EOF
clang -o lib1.so -target x86_64-unknown-elf 1.c -shared -fPIC
clang -o main.o -target x86_64-unknown-elf main.c -c
mv lib1.so A/lib64/lib1.so
ld.eld -o 1.eld.out --sysroot=A main.o -T script.t
ld.lld -o 1.lld.out --sysroot=A main.o -T script.t
ld.bfd -o 1.bfd.out --sysroot=A main.o -T script.t
eld does not expand
=and$SYSROOTinINPUTandGROUPcommands to sysroot.Reproducer: