Skip to content

= and $SYSROOT in INPUT|GROUP command does not expand to SYSROOT #927

@parth-07

Description

@parth-07

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  

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions