llvm-readelf warning on eld generated shared library: `unable to get section index for symbol with st_shndx = 0xfff1 (SHN_ABS)`
Open
@quic-seaswara is already working on this.
Since Oct 16, 2025.
bug
- Dominant language
- C++
- Stars
- 259
- Forks
- 84
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 72
Description
llvm-readelf is reporting the below warning when reading symbols of an eld-generated shared library:
llvm-readelf: warning: unable to get section index for symbol with st_shndx = 0xfff1 (SHN_ABS)
Reproducer:
cat > 1.c << EOF
int foo() { return 1; }
int bar() { return foo(); }
EOF
LDs=(ld.eld)
SFs=(eld)
# The issue is not directly reproducible using clang because clang does not emit
# empty .bss and .data sections.
riscv64-unknown-linux-gnu-gcc -o 1.o 1.s -fPIC -c -ffunction-sections
for i in "${!SFs[@]}"; do
${LDs[$i]} -o lib1.${SFs[$i]}.so 1.o -shared
done
The root cause of the issue is that we emit ghost section symbols to the output image, that is, section symbols for which there is no corresponding section.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.