================
@@ -3631,6 +3633,24 @@ static inline void printFields(formatted_raw_ostream
&OS, StringRef Str1,
OS.flush();
}
+template <class ELFT>
+std::string ELFDumper<ELFT>::getProgramHeadersNumString() {
+ const ELFFile<ELFT> &Obj = this->Obj;
+ Expected<uint32_t> PhNumOrErr = Obj.getPhNum();
+ if (!PhNumOrErr) {
+ this->reportUniqueWarning(PhNumOrErr.takeError());
+ return "<?>";
+ }
+
+ uint32_t PhNum;
+ PhNum = *PhNumOrErr;
+ if (PhNum == ELF::PN_XNUM)
+ return "65535 (corrupt)";
----------------
jh7370 wrote:
There doesn't appear to be any test for this case? Is this behaviour even
correct? What if there are exactly 65535 program headers?
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