Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nick,

On 3/22/23 19:25, Nick Desaulniers wrote:
On Fri, Feb 24, 2023 at 7:58 AM Björn Töpel <bjorn@xxxxxxxxxx> wrote:
Alexandre Ghiti <alex@xxxxxxxx> writes:

+cc linux-kbuild, llvm, Nathan, Nick

On 2/15/23 15:36, Alexandre Ghiti wrote:
From: Alexandre Ghiti <alex@xxxxxxxx>

I tried a lot of things, but I struggle to understand, does anyone have
any idea? FYI, the same problem happens with LLVM.
Off the top of my head, no idea.

(Maybe as a follow up to this series, I wonder if pursuing
ARCH_HAS_RELR for ARCH=riscv is worthwhile?)


IIUC, the goal for using RELR is to reduce the size of a kernel image: right now, this is not my priority, but I'll add that to my todo list because that may be useful to distros.



Don't ask me *why*, but adding --emit-relocs to your linker flags solves
"the NULL .rela.dyn" both for GCC and LLVM.

The downside is that you end up with a bunch of .rela cruft in your
vmlinux.
There was a patch just this week to use $(OBJCOPY) to strip these from
vmlinux (for x86). Looks like x86 uses --emit-relocs for KASLR:
https://lore.kernel.org/lkml/20230320121006.4863-1-petr.pavlu@xxxxxxxx/


That's nice, that would be an interesting intermediate step until we find the issue here as I believe it is important to have the relocations in the init section to save memory.

Thanks for your answer Nick, really appreciated,

Alex





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux