Re: [PATCH 1/3] LoongArch: tools: Add relocs tool support

From: Xi Ruoyao
Date: Sat Sep 03 2022 - 06:49:36 EST


On Sat, 2022-09-03 at 09:57 +0800, Youling Tang wrote:
> > > Unlike (pre-r6) MIPS, LoongArch has a complete support for PIC, and
> > > currently LoongArch toolchain always produces PIC (except, if -Wa,-mla-
> > > {local,global}-with-abs or la.abs macros are used explicitly).
> > >
> > > So would it be easier to review and correct the uses of "la.abs" in the
> > > code, and make the main kernel image a real PIE?  Then we can load it
> > > everywhere w/o any need to do relocation at load time.
>
> At the beginning I also wanted to make the main kernel image a real PIE
> and tried it, some of the "la.abs" can be modified, but I encountered
> difficulties in modifying the  exception handling code part, the kernel
> will not  boot after modification :(, I will continue to work hard try.

I just tried the same thing and get the same result :(. Will spend
several hours reading the LoongArch manual about exception...

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