[lkml]   [2006]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[Patch 1/4] avoid entry.S functions from reordering
    This patch puts the code from head.S in a special .bootstrap.text

    I'm working on a patch to reorder the functions in the kernel (I'll post
    that later), but for x86-64 at least the kernel bootstrap requires that the
    head.S functions are on the very first page/pages of the kernel text. This
    is understandable since the bootstrap is complex enough already and not a
    problem at all, it just means they aren't allowed to be reordered. This
    patch puts these special functions into a separate section to document this,
    and to guarantee this in the light of possibly reordering the rest later.

    (So this patch doesn't fix a bug per se, but makes things more robust by
    making the order of these functions explicit)

    Signed-off-by: Arjan van de Ven <>
    arch/x86_64/kernel/head.S | 1 +
    arch/x86_64/kernel/ | 1 +
    2 files changed, 2 insertions(+)

    Index: linux-reorder2/arch/x86_64/kernel/head.S
    --- linux-reorder2.orig/arch/x86_64/kernel/head.S
    +++ linux-reorder2/arch/x86_64/kernel/head.S
    @@ -26,6 +26,7 @@

    + .section .bootstrap.text
    .globl startup_32
    /* %bx: 1 if coming from smp trampoline on secondary cpu */
    Index: linux-reorder2/arch/x86_64/kernel/
    --- linux-reorder2.orig/arch/x86_64/kernel/
    +++ linux-reorder2/arch/x86_64/kernel/
    @@ -20,6 +20,7 @@ SECTIONS
    phys_startup_64 = startup_64 - LOAD_OFFSET;
    _text = .; /* Text and read-only data */
    .text : AT(ADDR(.text) - LOAD_OFFSET) {
    + *(.bootstrap.text)
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-02-27 16:36    [W:0.024 / U:8.356 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site