Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries

From: Ingo Molnar
Date: Thu Dec 28 2017 - 07:05:41 EST



* Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> wrote:

> Annoyingly, we need this because there is a single instance of a
> special section that ends up in the EFI stub code: we build lib/sort.c
> again as a EFI libstub object, and given that sort() is exported, we
> end up with a ksymtab section in the EFI stub. The sort() thing has
> caused issues before [0], so perhaps I should just clone sort.c into
> drivers/firmware/efi/libstub and get rid of that hack.
>
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=29f9007b3182ab3f328a31da13e6b1c9072f7a95

If the root problem is early bootstrap code randomly using generic facility that
isn't __init, then we should definitely improve tooling to at least detect these
problems.

As bootstrap code gets improved (KASLR, more complex decompression, etc. etc.) we
keep using new bits of generic facilities...

So this should definitely not be hidden by open coding that function (which has
various other disadvantages as well), but should be turned from silent breakage
either into non-breakage (and do so not only for sort() but for other generic
functions as well), or should be turned into a build failure.

Thanks,

Ingo