[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


================
@@ -0,0 +1,49 @@
+## When an ELF object has PN_XNUM (0xffff) or more sections, its e_phnum field
+## should be PN_XNUM and sh_info of the section header at index 0 is used
+## to store the value.
+
+# RUN: yaml2obj --docnum=1 %s -o %t1
+# RUN: llvm-readelf --file-headers %t1 | FileCheck %s --check-prefix=VALID-GNU
+# RUN: llvm-readobj --file-headers %t1 | FileCheck %s --check-prefix=VALID-LLVM
----------------
jh7370 wrote:

Given that the program header count impacts dumping of program headers, you should add --program-headers to these test cases, to show that all the program headers are properly dumped and not just the file header count field.

https://github.com/llvm/llvm-project/pull/165278


More information about the llvm-branch-commits mailing list