Re: [PATCH] RISC-V: Make CONFIG_RELOCATABLE user selectable

From: Palmer Dabbelt
Date: Wed Oct 27 2021 - 19:09:09 EST


On Wed, 27 Oct 2021 02:45:27 PDT (-0700), schwab@xxxxxxxxxxxxxx wrote:
On Okt 27 2021, Alexandre Ghiti wrote:

On Wed, Oct 27, 2021 at 10:03 AM Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:

On Okt 26 2021, Palmer Dabbelt wrote:

> +config RELOCATABLE
> + bool "Build a relocatable kernel"
> + depends on MMU && 64BIT && !XIP_KERNEL
> + help
> + This builds a kernel as a Position Independent Executable (PIE),
> + which retains all relocation metadata required to relocate the
> + kernel binary at runtime to a different virtual address than the
> + address it was linked at.
> + Since RISCV uses the RELA relocation format, this requires a
> + relocation pass at runtime even if the kernel is loaded at the
> + same address it was linked at.

When in doubt, do what?

Then do not enable.

Please add that to the help string.

Thanks, I forgot about that. I've added it, but this is still a bit in flux so I'm not going to send a v2 right now (it's on top of Alex's other patches and should probably be squashed in, anyway).