[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9880165f0355fc3be3ec23153b43ad33e558b5d.camel@xry111.site>
Date: Fri, 02 Sep 2022 19:10:25 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Youling Tang <tangyouling@...ngson.cn>,
Huacai Chen <chenhuacai@...nel.org>
Cc: linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
Xuerui Wang <kernel@...0n.name>,
Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: Re: [PATCH 1/3] LoongArch: tools: Add relocs tool support
Hi Youling,
On Fri, 2022-09-02 at 18:08 +0800, Youling Tang wrote:
> This tool is based on the arch/mips/boot/tools/relocs tool.
I've dig some history of MIPS relocatable kernel
(https://lwn.net/Articles/682020/):
* Kernel is compiled & statically linked as normal, with no position
independent code. MIPS before R6 only has limited relative jump
instructions so the vast majority of jumps are absolute. To compile
the kernel position independent would introduce a highly undesireable
overhead. Relocating the static binary gives a small startup time
penalty but the kernel otherwise perforns normally.
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.
--
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists