[PATCH] D154665: fixed invalid symbol handling in ELFObjectFile::getSymbolName

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 16:08:12 PDT 2023


MaskRay added a comment.

To me, the filename `section-no-symbol-name.test` is not accurate as almost all STT_SECTION symbols don't have names.
Tools like llvm-nm/llvm-readelf use heuristics to give the section name (see D57105 <https://reviews.llvm.org/D57105>).

I am mainly thinking of https://maskray.me/blog/2021-08-08-toolchain-testing "I don't know an existing test can be enhanced".
I usually search for the diagnostics (`invalid section index`) to find related tests. In this case, it seems that we do want a `llvm-objdump -d` test as `llvm-objdump -t` reports an error instead of warning, stopping further processing.
With more investigation, I think we probably should port a llvm-readobj behavior. See D154754 <https://reviews.llvm.org/D154754>.

With D154754 <https://reviews.llvm.org/D154754>, I think you can enhance a test by adding `-d` beside `--syms`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154665/new/

https://reviews.llvm.org/D154665



More information about the llvm-commits mailing list