[PATCH] Fix IAT (Import Address Table) alignment on AArch64

Jan Beulich jbeulich@suse.com
Fri Apr 10 13:21:42 GMT 2026


On 09.04.2026 16:40, Evgeny Karpov wrote:
> It looks like make_one_lib_file uses the alignment from secdata_plain to create 
> .idata$5 section, which will be placed after .idata$5 head section created by
> make_head. make_head does not have an alignment without the patch introduced earlier.
> however it has a reference to the first chunk, that should be aligned.
> And the order is defined later in gen_lib_file.

Hmm, isn't it then a/the problem that make_head() doesn't consult the secdata
variant in use at all? Shouldn't it emit an alignment directive in all cases
(for 32-bit targets 4-byte alignment ought to also be needed)? And aren't
other .idata$<N> (except .idata$7) having the same issue then? The 4-byte
alignment presently looks to merely be an effect of gas / libbfd (for COFF)
giving all sections at least that alignment (specifically
COFF_DEFAULT_SECTION_ALIGNMENT_POWER, which some targets also set to less
than 2).

Further .idata$4 looks to also want 8-byte alignment for PE32+, judging from
the data that is being put there.

Jan


More information about the Binutils mailing list