]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
objdump: Fix private header ('-p') import table output for pe-aarch64
authorJon Turney <jon.turney@dronecode.org.uk>
Fri, 19 Jun 2026 12:47:03 +0000 (13:47 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Thu, 2 Jul 2026 14:26:16 +0000 (15:26 +0100)
The private header ('-p') import table output for pe-aarch64 (and
probably all other 64-bit arches apart from x86_64) is truncated after the
first import.

The distinction between the conditional branches here should be between
PE32 (32-bit) and PE32+ (somewhat confusingly, the 64-bit version of the
PE format).

PE file format specification [1] states under "Import Lookup Table":

"An import lookup table is an array of 32-bit numbers for PE32 or an
array of 64-bit numbers for PE32+."

[1] https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#import-lookup-table

2026-06-19  Jon Turney  <jon.turney@dronecode.org.uk>

* peXXigen.c (pe_print_idata): Fix conditional.

bfd/peXXigen.c

index bdb23dcbcab0be87c1ef3ba5a533135bada8e9d2..f604a84ec0adff17ef0ee3ba0cd748450dc784ea 100644 (file)
@@ -1462,7 +1462,9 @@ pe_print_idata (bfd * abfd, void * vfile)
            }
 
          /* Print HintName vector entries.  */
-#ifdef COFF_WITH_pex64
+#if defined COFF_WITH_pep || defined COFF_WITH_pex64 \
+    || defined COFF_WITH_peAArch64 || defined COFF_WITH_peLoongArch64 \
+    || defined COFF_WITH_peRiscV64
          for (j = 0; idx + j + 8 <= datasize; j += 8)
            {
              bfd_size_type amt;