File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
contrib/elftoolchain/readelf Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2112,7 +2112,7 @@ dwarf_reg(unsigned int mach, unsigned int reg)
2112
2112
static void
2113
2113
dump_ehdr (struct readelf * re )
2114
2114
{
2115
- size_t shnum , shstrndx ;
2115
+ size_t phnum , shnum , shstrndx ;
2116
2116
int i ;
2117
2117
2118
2118
printf ("ELF Header:\n" );
@@ -2174,7 +2174,13 @@ dump_ehdr(struct readelf *re)
2174
2174
re -> ehdr .e_phentsize );
2175
2175
2176
2176
/* e_phnum. */
2177
- printf ("%-37s%u\n" , " Number of program headers:" , re -> ehdr .e_phnum );
2177
+ printf ("%-37s%u" , " Number of program headers:" , re -> ehdr .e_phnum );
2178
+ if (re -> ehdr .e_phnum == PN_XNUM ) {
2179
+ /* Extended program header numbering is in use. */
2180
+ if (elf_getphnum (re -> elf , & phnum ))
2181
+ printf (" (%zu)" , phnum );
2182
+ }
2183
+ putchar ('\n' );
2178
2184
2179
2185
/* e_shentsize. */
2180
2186
printf ("%-37s%u (bytes)\n" , " Size of section headers:" ,
You can’t perform that action at this time.
0 commit comments