Re: [PATCH v4 2/5] LoongArch: Use la.pcrel instead of la.abs for exception handlers

From: Xi Ruoyao
Date: Thu Feb 16 2023 - 02:10:41 EST


On Thu, 2023-02-16 at 14:59 +0800, Jinyang He wrote:
> +.macro la.abs reg, sym
> +766:
> +    nop
> +    nop
> +    nop
> +    nop

In the "formal" version we can code

lu12i.w reg, 0
ori reg, reg, 0
lu32i.d reg, 0
lu52i.d reg, reg, 0

here. Then we only need to fixup the immediate slot so we can avoid
using parse_r.


> +    .pushsection ".laabs", "aw", %progbits
> +768:
> +    .word 768b-766b
> +    parse_r regno, \reg
> +    .word regno
> +    .dword \sym
> +    .popsection
> +.endm

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