[PATCH] arm64: Fix transient negative image size observed by the linker
Ard Biesheuvel
ardb at kernel.org
Tue Dec 1 05:50:15 PST 2026
On Tue, 1 Dec 2026, at 14:29, Ard Biesheuvel wrote:
> On Tue, 1 Dec 2026, at 14:17, Catalin Marinas wrote:
>> Hi Ard,
>>
>> On Mon, Nov 30, 2026 at 06:51:22PM +0100, Ard Biesheuvel wrote:
>>> From: Ard Biesheuvel <ardb at kernel.org>
>>>
>>> LLD occasionally errors out with a mysterious 'assignment to symbol foo
>>> does not converge', usually with a 16k page size kernel config.
>>>
>>> This turns out to be caused by the evaluation of the SPAN_NR_ENTRIES()
>>> macro using a preliminary value for _end that is below KIMAGE_VADDR,
>>> resulting in the difference to become negative. Subsequent passes
>>> usually recover from this, but not always, hence the config-dependent
>>> error.
>>>
>>> So ensure that SPAN_NR_ENTRIES() returns 1 for spans where the end
>>> address is smaller than or equal to the start address. This never
>>> occurs on the linker passes that matter, but prevents the iterative
>>> algorithm that LLD implements from diverging.
>>>
>>> This reverts commit dc0a08394804 ("arm64: Work around convergence
>>> issue with LLD linker"), which is superseded by this change.
>>>
>>> Reported-by: kernel test robot <lkp at intel.com>
>>> Closes: https://lore.kernel.org/oe-kbuild-all/20261129124345.eiR8unSx-lkp@intel.com/
>>
>> Is this happening with your efi-zboot-elf branch only or mainline as
>> well? If the latter, we'd need a Fixes tag and cc stable. I'm not sure
>> what Arnd tested on.
>>
>> Your branch moves the INIT_IDMAP_DIR_SIZE and INIT_DIR_SIZE reservations
>> inside the sections and they depend on _end. IIUC, they become part of
>> the section size and moving '.' backwards is an error. I found another
>> report on your branch, not sure it's related but it looks like it's
>> caused by wrapped values:
>>
>> https://lore.kernel.org/all/20261120005637.8iy6yHZU-lkp@intel.com/
>>
>
> That just happens to be the branch where it was found this time, but
> it is not related to any of those changes.
>
> Arnd's testing should be entirely unrelated to any of this.
>
I double checked: the randconfig from the linked report fails in a
similar way with v7.4-rc1 (but on a different symbol)
ld.lld-22: error: address (0xfffffff882fb4000) of section '.init.data' does not converge
ld.lld-22: error: assignment to symbol __init_end does not converge
More information about the linux-arm-kernel
mailing list