[lld] [LLD] dtNeeded name should consistent with soNames (PR #72857)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 20 22:07:02 PST 2023
MaskRay wrote:
I suspect that you have an incorrect use case, but the case is not clearly described and I cannot verify.
This inconcistency what we will get when a shared object does not have `DT_SONAME` (https://maskray.me/blog/2020-11-15-explain-gnu-linker-options#sonamename)
FYI I place all needed files in a directory and run `cd dir; mkreproduce . > /tmp/rep.sh` to create `cat <<eof` and `echo` instructions that other people can easily reproduce. (e.g. https://maskray.me/blog/2020-11-26-all-about-symbol-versioning#version-script)
```
#!/bin/zsh
dry_run=
if [[ $1 == --dry-run ]]; then dry_run=1; shift; fi
f() {
for f in $1/*(ND.^x); do
[[ ${f##*/} =~ '^\.' ]] && continue
if [[ -n $dry_run ]]; then
echo $f
elif [[ $(wc -l < $f) == 1 ]]; then
echo "echo '$(<$f)' > $f"
else
if [[ ${f##*/} == Makefile ]]; then
printf '%s\n' "sed 's/^ /\\t/' > $f <<'eof'"
else
echo "cat > $f <<'eof'"
fi
cat $f
echo eof
fi
done
for d in $1/*(ND/); do
[[ $d =~ '^\.' ]] && continue
echo mkdir -p $d
f $d
done
}
f ${1:-.}
```
```
clang case/use.c -o exe/libuse.so -lhave -Lexe --shared -fPIC
```
The `-o libuse.so` instruction does not mention how you switched the directory, so the example is difficult to follow.
https://github.com/llvm/llvm-project/pull/72857
More information about the llvm-commits
mailing list