[Top] [All Lists]

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

To: Linus Torvalds <>
Subject: Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries
From: Ard Biesheuvel <>
Date: Wed, 27 Dec 2017 20:24:27 +0000
Cc: Linux Kernel Mailing List <>, "H. Peter Anvin" <>, Ralf Baechle <>, Arnd Bergmann <>, Heiko Carstens <>, Kees Cook <>, Will Deacon <>, Michael Ellerman <>, Thomas Garnier <>, Thomas Gleixner <>, "Serge E. Hallyn" <>, Bjorn Helgaas <>, Benjamin Herrenschmidt <>, Russell King <>, Paul Mackerras <>, Catalin Marinas <>, "David S. Miller" <>, Petr Mladek <>, Ingo Molnar <>, James Morris <>, Andrew Morton <>, Nicolas Pitre <>, Josh Poimboeuf <>, Steven Rostedt <>, Martin Schwidefsky <>, Sergey Senozhatsky <>, Jessica Yu <>,, linux-mips <>, ppc-dev <>, linux-s390 <>,, "the arch/x86 maintainers" <>, Ingo Molnar <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GuQxXFML0Wn4s0cVbibY/a5Gq/rU8fF16au7Ke5sbyY=; b=bJOvBIlmgNSg/ZuoypuGjxwxRXsusf8PU9tZcnFAXLtNzOdAi0dJX7q8fbGYqVzLx5 GC1o0gf9MbsMDT5CaFLe2dUruWDdXmSLznKrgTTG0UtkbNtGrdEnydeDKgI//eUCFJhf TK2wlElo0/RvngtHpX38BzLSUhacOu7ucE/zo=
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <> <> <> <> <>
On 27 December 2017 at 20:13, Linus Torvalds
<> wrote:
> On Wed, Dec 27, 2017 at 12:11 PM, Ard Biesheuvel
> <> wrote:
>> I tried to keep the generic patches generic, so perhaps I should just
>> put the arm64 change in a patch on its own?
> I guess it doesn't matter, but regardless of where it gets introduced
> I would like to see the explanation for where the heck that magical
> ".init.discard.text" comes from. It's definitely not obvious from the
> patches, and is presumably some odd arm64 special case.

This has to do with the EFI stub. x86 and ARM link it into the
decompressor, and so the code and data are not annotated as __init
(and doing so would involve modifying a lot of code). arm64 does not
have a decompressor, and so the EFI stub is linked into the kernel
proper. To make sure the code ends up in the .init segment, all
sections are prepended with .init at the object level, using objcopy.

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.


<Prev in Thread] Current Thread [Next in Thread>