================
@@ -3572,45 +3572,62 @@ static inline void printFields(formatted_raw_ostream
&OS, StringRef Str1,
OS.flush();
}
+template <class ELFT>
+static std::string getProgramHeadersNumString(const ELFFile<ELFT> &Obj,
+ StringRef FileName) {
+
+ if (Obj.getHeader().e_phnum != ELF::PN_XNUM)
+ return to_string(Obj.getHeader().e_phnum);
----------------
jh7370 wrote:
This should probably be using `Obj.getPhNum()`, as we discussed in the other
review that clients should avoid referencing `e_phnum` directly (although I
acknowledge that the check versus `PN_XNUM` is still needed in this context).
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