gas .align limit

Jan Beulich jbeulich@suse.com
Mon May 19 06:03:02 GMT 2025
On 19.05.2025 02:34, Alan Modra wrote:
> On Sun, May 18, 2025 at 09:59:08AM +0200, Jan Beulich wrote:
>> On 17.05.2025 12:14, Alan Modra wrote:
>>> I've been looking at removing any requirement that rs_align_code
>>> frags need lots of memory.  They should not, because the patterns of
>>> nops used always have repeating sequences, and the repeating part only
>>> needs memory for one repeat.  The attached patch cleans up all the
>>> target HANDLE_ALIGN code, except for x86_64.  I've left x86 because
>>> I'm unsure whether it matters that the short nop sequence is last.  If
>>> it doesn't matter then it can be placed first, and the repeating part
>>> handled as for all other targets.  If it should remain last then it
>>> needs to be moved to a separate frag as is done for the group ending
>>> nop on ppc.
>>
>> I don't think the ordering really matters, but some testcases may have
>> been having respective expectations (which ought to be fine to change).
>> Iirc for long enough sequences we may emit JMP, though, and that
>> obviously needs to stay first.
> 
> OK, the code change is easy, the testsuite changes a pain.

As expected; thanks for wading through it.

> rs_fill_nop ought to be changed similarly too.  Maybe later.
> 
> From cf2ade6c580ec524d815f94a2479434ca3835257 Mon Sep 17 00:00:00 2001
> From: Alan Modra <amodra@gmail.com>
> Date: Mon, 19 May 2025 00:27:54 +0930
> Subject: tidy x86 HANDLE_ALIGN
> 
> Reduce memory requirement for .align in code.
> 
> I've changed some of the tests to use "clc" rather than "nop", so that
> code emitted by .p2align can be clearly seen.

Makes (a lot of) sense, yes.

Jan


More information about the Binutils mailing list