public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Dan Aloni <da-x@monatomic.org>,
	Bernhard Walle <bwalle@suse.de>,
	Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH] Add ELF note with Linux version
Date: Fri, 14 Sep 2007 23:07:38 +0200	[thread overview]
Message-ID: <20070914210738.GA5031@uranus.ravnborg.org> (raw)
In-Reply-To: <46EAE534.5030900@goop.org>

> > This seems outright silly.
> > Either we should revert the notes changes or someone caring about it 
> > should sweep all archs and make sure it does not hurt there.
> 
> Hm, sounds like yet another binutils bug; unfortunately common when ELF
> notes are about.  Was there any further effort to isolate what was
> causing the problem?

Lennart posted this:
An ARM vmlinux kernel image built with pre-build-id binutils has:

        Program Header:
            LOAD off    0x00008000 vaddr 0xc0008000 paddr 0xc0008000 align 2**15
                 filesz 0x002e503c memsz 0x003032c0 flags rwx
        private flags = 4000002: [Version4 EABI] [has entry point]


Whereas a build-id binutils-built vmlinux kernel image ends up with:

        Program Header:
            LOAD off    0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**15
                 filesz 0x00000024 memsz 0x00000024 flags r--
            LOAD off    0x00010000 vaddr 0xc0008000 paddr 0xc0008000 align 2**15
                 filesz 0x002e503c memsz 0x003032c0 flags rwx
            NOTE off    0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**2
                 filesz 0x00000024 memsz 0x00000024 flags r--
        private flags = 4000002: [Version4 EABI] [has entry point]


The .note.gnu.build-id section causes objcopy to produce a 3G+
Image file, breaking the build.


Samuel Ortiz posted following patch:
> With build-id binutils (e.g. the latest bintuils 2.18), objcopy produces
> a 3.1 Gbytes Image file. Adding a note section fixes the problem.
> 
> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
> Cc: Lennert Buytenhek <buytenh@wantstofly.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> 
> ---
>  arch/arm/kernel/vmlinux.lds.S |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: linux-2.6.22/arch/arm/kernel/vmlinux.lds.S
> ===================================================================
> --- linux-2.6.22.orig/arch/arm/kernel/vmlinux.lds.S   2007-09-11 18:32:29.000000000 +0200
> +++ linux-2.6.22/arch/arm/kernel/vmlinux.lds.S        2007-09-11 18:33:42.000000000 +0200
> @@ -94,6 +94,7 @@
>                       TEXT_TEXT
>                       SCHED_TEXT
>                       LOCK_TEXT
> +                     *(.note.*)
>  #ifdef CONFIG_MMU
>                       *(.fixup)
>  #endif


I cannot see why this should fix it since the patch does
not discard the section. Maybe the inclusion of the section in
some oter section does some good.

Anyway the original submitter of the build-id should have identified such
issues and fixed all archs.

And I still do not get exactly what problem the note section solves when
included in vmlinux....

	Sam

  reply	other threads:[~2007-09-14 21:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 15:00 [PATCH] Add ELF note with Linux version Bernhard Walle
2007-09-06 10:36 ` Jeremy Fitzhardinge
2007-09-13 21:42   ` Andrew Morton
2007-09-13 21:56     ` Jeremy Fitzhardinge
2007-09-14  7:52       ` Bernhard Walle
2007-09-14 20:00         ` Jeremy Fitzhardinge
2007-09-13 22:13     ` Sam Ravnborg
2007-09-13 22:44       ` Jeremy Fitzhardinge
2007-09-14  6:08         ` Sam Ravnborg
2007-09-14 19:47           ` Jeremy Fitzhardinge
2007-09-14 21:07             ` Sam Ravnborg [this message]
2007-09-14 21:15               ` Roland McGrath
2007-09-14 21:31               ` Jeremy Fitzhardinge
2007-09-15  1:30                 ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070914210738.GA5031@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=bwalle@suse.de \
    --cc=da-x@monatomic.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox