binutils Newspaper
JUNE 15, 2026
binutils Proposed

Fix IAT (Import Address Table) alignment on AArch64

This patch aligns the Import Address Table (IAT) to 8 bytes for PE32+ on AArch64 to prevent relocation issues.

This patch aligns the Import Address Table (IAT) to 8 bytes for PE32+ binaries on AArch64. This ensures that addresses placed in the IAT are properly aligned for ldr (load register) instructions, preventing potential relocation issues. The patch modifies binutils/dlltool.c to implement the alignment.

In the Thread 2 participants
  1. Evgeny Karpov <evgeny.karpov@arm.com> proposer

    Proposes a patch to align the IAT to 8 bytes for PE32+ on AArch64 to fix relocation issues.

    “The IAT should be aligned to 8 bytes in aarch64-w64-mingw32, otherwise, it might result in relocation issues. When a function is imported from DLL, it generates the following code: adrp x19, __imp_fn lodr x19, [x19, #:lo12:__imp_fn] 8 byte alignment is required for ldr relocation. Addresses are placed in IAT.”
  2. Evgeny Karpov <evgeny.karpov@arm.com> other

    Explains that 8-byte alignment is required for ldr relocation.

Technical Tradeoffs

  • Ensures correct memory access and prevents relocation errors on AArch64.
  • Adds a small amount of padding to the IAT to enforce alignment.
  • No significant performance impact expected.

In Details

This patch addresses an alignment issue in the Import Address Table (IAT) for PE32+ binaries on AArch64, specifically when targeting the MinGW environment. The IAT, used for storing addresses of imported functions, needs to be 8-byte aligned to ensure compatibility with ldr instructions used for accessing these addresses. Lack of alignment can lead to relocation errors, requiring a fix in dlltool.c.

For Context

When a program uses functions from a Dynamic Link Library (DLL), the addresses of those functions need to be stored in a table called the Import Address Table (IAT). On AArch64 systems, especially when using the PE32+ binary format (common on Windows), the IAT needs to be aligned to a specific memory boundary (8 bytes in this case). This alignment is required because the instructions used to load addresses from the IAT (ldr) expect this alignment. If the IAT is not properly aligned, the program may crash or behave unpredictably due to incorrect memory access.

Part of a Series

Filed Under: binutilsaarch64iatalignmentpe32+