Re: [PATCH v4 0/4] LoongArch: Support new relocation types

From: Xi Ruoyao
Date: Tue Aug 02 2022 - 03:16:02 EST


On Tue, 2022-08-02 at 14:39 +0800, Lulu Cheng wrote:

> >
> >  OO, old toolchains require extra handlingg no matter how modified.
> >  Maybe rejecting old toolchain builds is a good option as Huacai
> > said.

> Sorry to ask, is it possible to use an absolute address to visit here?
> Like precpu, do not use pcrel or got, and it directly uses
> four instructions to obtain the absolute address.
> The same is achieved by adding attributes in GCC.

Both GOT and ABS will work. But to me GOT is better because it only
needs two instructions while ABS needs four.

The most troubling issue is how to support the old GCC. It seems we
have to check GCC version and use -Wa,-mla-local-with-pcrel for GCC 12
(while I still think GOT is better but we don't have -mla-local-with-
got, *and* it will cause make every local object address load cost 4
instructions), or we just say "it's impossible to use GCC 12 to build
Linux 6.0 for LoongArch".

--
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University