[lld] [llvm] [Object][ELF] Support extended header for Object Parser in ELF (PR #162288)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 8 00:38:27 PDT 2025
================
@@ -772,7 +779,7 @@ template <class ELFT>
Expected<StringRef>
ELFFile<ELFT>::getSectionStringTable(Elf_Shdr_Range Sections,
WarningHandler WarnHandler) const {
- uint32_t Index = getHeader().e_shstrndx;
+ uint32_t Index = e_shstrndx;
----------------
jh7370 wrote:
Changes like this seem a bit muddled to me, in that I'd expect `e_shstrndx` to have been resolved to the real index as part of constructing `ELFFile`, meaning you don't then need to compare it against `SHN_XINDEX` below.
It suggests to me that either you've got code left around from earlier versions of the change, or you aren't resolving the real values early enough. I don't want to end up in a situation where people will have to study the code to know whether `e_shstrndx` etc needs to be checked against `SHN_XINDEX`. This may mean avoiding calls to certain functions during the `ELFFile` constructor, at least until this resolution has taken place.
https://github.com/llvm/llvm-project/pull/162288
More information about the llvm-commits
mailing list