lkml.org 
[lkml]   [2009]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [tip:x86/urgent] x86: Add back _end symbol that is missing from Symbol.map
    On Sun, Nov 08, 2009 at 12:48:29PM +0100, Ingo Molnar wrote:
    >
    > * Sam Ravnborg <sam@ravnborg.org> wrote:
    >
    > > On Sun, Nov 08, 2009 at 11:07:12AM +0000, tip-bot for Hannes Reinecke wrote:
    > > > Commit-ID: d1e4d37b79e944f6351ae38eb1ca7c9f7b506e76
    > > > Gitweb: http://git.kernel.org/tip/d1e4d37b79e944f6351ae38eb1ca7c9f7b506e76
    > > > Author: Hannes Reinecke <hare@suse.de>
    > > > AuthorDate: Wed, 4 Nov 2009 07:19:32 -0800
    > > > Committer: Ingo Molnar <mingo@elte.hu>
    > > > CommitDate: Sun, 8 Nov 2009 12:05:03 +0100
    > > >
    > > > x86: Add back _end symbol that is missing from Symbol.map
    > > >
    > > > With 2.6.31 'crash' on x86_64 falls flat on its face as the
    > > > '_end' symbol is missing from the System.map file.
    > > >
    > > > The culprit is commit 091e52c3551d3031343df24b573b770b4c6c72b6,
    > > > which moved the '_end' symbol into it's own section. Apparently
    > > > this causes kallsyms to not reference it properly.
    > > >
    > > > So do not include _end in it's own section.
    > > >
    > > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    > > > Cc: Sam Ravnborg <sam@ravnborg.org>
    > > > Cc: <stable@kernel.org> # .31.x
    > > > LKML-Reference: <200911041519.nA4FJWEW030164@imap1.linux-foundation.org>
    > > > Signed-off-by: Ingo Molnar <mingo@elte.hu>
    > >
    > > I'm afraid this will break a RELOCTABLE i386 kernel.
    > >
    > > We fixed this up some time ago where we had to
    > > move the symbol definition inside a section
    > > to prevent the symbol being absolute.
    >
    > ah, indeed. So ... the question is then, why did _end disappear from
    > System.map?
    I think ld discards zero size sections. No need to keep them around
    if they are empty.

    Following patch should fix it up in a better way.
    I reused most of Hannes changelog.

    Sam

    [PATCH] x86: Add back _end symbol that is missing from Symbol.map

    With 2.6.31 'crash' on x86_64 falls flat on its face as the
    '_end' symbol is missing from the System.map file.

    The culprit is commit 091e52c3551d3031343df24b573b770b4c6c72b6,
    which moved the '_end' symbol into it's own section.

    The problem is likely that ld discards empty sections.
    So move the definition of _end into the last section defined.

    Cc: Hannes Reinecke <hare@suse.de>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: <stable@kernel.org> # .31.x
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


    diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
    index 92929fb..c58a6e3 100644
    --- a/arch/x86/kernel/vmlinux.lds.S
    +++ b/arch/x86/kernel/vmlinux.lds.S
    @@ -289,9 +289,12 @@ SECTIONS
    . += 64 * 1024; /* 64k alignment slop space */
    *(.brk_reservation) /* areas brk users have reserved */
    __brk_limit = .;
    - }

    - .end : AT(ADDR(.end) - LOAD_OFFSET) {
    + /*
    + * To support RELOCTABLE kernel _end must be inside a section.
    + * And ld is know to discard empty section so we locate _end in
    + * last section we define.
    + */
    _end = .;
    }


    \
     
     \ /
      Last update: 2009-11-08 13:41    [W:0.025 / U:60.924 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site