qualcomm / qualcomm/eld

llvm-readelf warning on eld generated shared library: `unable to get section index for symbol with st_shndx = 0xfff1 (SHN_ABS)`

Open
#445 0 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.