================
@@ -4778,8 +4795,10 @@ void GNUELFDumper<ELFT>::printProgramHeaders(
     return;
 
   if (PrintProgramHeaders) {
-    const Elf_Ehdr &Header = this->Obj.getHeader();
-    if (Header.e_phnum == 0) {
+    Expected<uint32_t> PhNumOrErr = this->Obj.getPhNum();
+    if (!PhNumOrErr) {
+      OS << '\n' << errorToErrorCode(PhNumOrErr.takeError()).message() << '\n';
----------------
jh7370 wrote:

This isn't how warnings are printed in llvm-readobj. Please review the existing 
code and fix it accordingly.

https://github.com/llvm/llvm-project/pull/165278
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to