Re: [RFC/RFT PATCH 08/19] x86: Use PIE codegen for the relocatable 64-bit kernel

Ard Biesheuvel
2026-01-09T22:07:45Z

On Fri, 9 Jan 2026 at 22:34, Jan Engelhardt <ej@inai.de> wrote:
>
>
> On Thursday 2026-01-08 10:25, Ard Biesheuvel wrote:
> >
> >As an intermediate step towards enabling PIE linking for the x86_64
> >KASLR kernel, enable PIE codegen for all C and Rust objects that are
> >linked into the kernel proper. Add a Kconfig option RELOCATABLE_PIE for
> >this, depending on RELR support in the linker, as the relocation tables
> >will blow up the kernel image otherwise.
>
>
> > KBUILD_CFLAGS += $(call cc-option,-fcf-protection=branch -fno-jump-tables)
> >...
> >+
> >+ pie-ccflags-$(CONFIG_CC_IS_GCC) += $(call cc-option.-mdirect-extern-access)
>
> I think that dot there next to -mdirect-extern-accesss should have been
> a comma.
>

Indeed, thanks for spotting that!