[PATCH] ARM: entry: add .ltorg directive to keep literals in range

Nick Desaulniers ndesaulniers at google.com
Wed Jun 8 11:42:03 PDT 2022


On Wed, Jun 1, 2022 at 4:36 AM Ard Biesheuvel <ardb at kernel.org> wrote:
>
> On Tue, 31 May 2022 at 17:29, Nathan Chancellor <nathan at kernel.org> wrote:
> >
> > On Mon, May 30, 2022 at 01:24:17PM +0200, Ard Biesheuvel wrote:
> > > LKP reports a build issue on Clang, related to a literal load of
> > > __current issued through the ldr_va macro. This turns out to be due to
> > > the fact that group relocations are disabled when CONFIG_COMPILE_TEST=y,
> > > which means that the ldr_va macro resolves to a pair of LDR
> > > instructions, the first one being a literal load issued too far from its
> > > literal pool.
> >
> > For the record, I do see a similar failure with GNU as, not sure if it
> > is worth calling that out in the commit message or not:
> >
> > arch/arm/kernel/entry-common.S: Assembler messages:
> > arch/arm/kernel/entry-common.S:149: Error: invalid literal constant: pool needs to be closer
> >
>
> Correct, the underlying issue is not specific to Clang. I did notice,
> though, that the Clang assembler does not deduplicate literal pool
> entries like GAS does, which might make Clang more susceptible than
> GCC/binutils.

Thanks for the report; just circling back on this, but this should be
resolved in ToT (clang-15):
https://github.com/llvm/llvm-project/issues/55816

>
> In any case, the fix is not Clang-specific.

-- 
Thanks,
~Nick Desaulniers



More information about the linux-arm-kernel mailing list