[llvm-branch-commits] [llvm] [llvm-readobj, ELF] Support reading binary with more than PN_XNUM segments. (PR #165278)
James Henderson via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Mar 4 02:41:37 PST 2026
================
@@ -4853,10 +4875,16 @@ template <class ELFT> void GNUELFDumper<ELFT>::printProgramHeaders() {
const Elf_Ehdr &Header = this->Obj.getHeader();
Field Fields[8] = {2, 17, 26, 37 + Bias,
48 + Bias, 56 + Bias, 64 + Bias, 68 + Bias};
+ uint32_t PhNum = 0;
+ if (Expected<uint32_t> PhNumOrErr = this->Obj.getPhNum(); PhNumOrErr)
+ PhNum = *PhNumOrErr;
+ else
+ this->reportUniqueWarning(PhNumOrErr.takeError());
----------------
jh7370 wrote:
We don't generally need to mirror GNU's output for warnings/errors. I just wanted to make sure GNU didn't print "0" or something weird like that for this case.
https://github.com/llvm/llvm-project/pull/165278
More information about the llvm-branch-commits
mailing list