[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
Fri Oct 31 02:06:26 PDT 2025


================
@@ -0,0 +1,79 @@
+## Show that llvm-readelf can handle an input file with many segments.
+
+RUN: %python %p/../../llvm-objcopy/Inputs/ungzip.py %p/Inputs/many-segments.o.gz > %t
----------------
jh7370 wrote:

Let's not rely on a large file to test this behaviour when we don't have to.

As noted in a previous comment somewhere, you can use yaml2obj to craft an object with e_phnum set to PN_XNUM and then a low number in the SHT_NULL section header.

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


More information about the llvm-branch-commits mailing list