public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Magnus Damm <magnus@valinux.co.jp>
Cc: linux-kernel@vger.kernel.org, Vivek Goyal <vgoyal@in.ibm.com>,
	Andi Kleen <ak@muc.de>,
	magnus.damm@gmail.com, fastboot@lists.osdl.org,
	Horms <horms@verge.net.au>, Dave Anderson <anderson@redhat.com>
Subject: Re: [PATCH 02/02] Elf: Align elf notes properly
Date: Thu, 09 Nov 2006 07:00:22 -0700	[thread overview]
Message-ID: <m1psbwzpmx.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20061102101949.452.23441.sendpatchset@localhost> (Magnus Damm's message of "Thu, 02 Nov 2006 19:19:49 +0900")

Magnus Damm <magnus@valinux.co.jp> writes:

> elf: Align elf notes properly
>
> The kernel currently contains several elf note aligment implementations. Most
> implementations follow the spec on 32-bit platforms, but none current aligns
> the notes correctly on 64-bit platforms. This patch tries to fix this by
> interpreting the 64-bit and 32-bit elf specs as the following:
>
> offset bytes name
> 0      4     n_namesz -+                  -+
> 4      4     n_descsz  | elf note header   |
> 8      4     n_type   -+                   | elf note entry size - N4
> 12     N1    name                          |
> N2     N3    desc                         -+
>
> WS = word size in bytes (4 for 32 bit, 8 for 64 bit)
> N1 = roundup(n_namesz + sizeof(elf note header), WS) - sizeof(elf note header)
> N2 = sizeof(elf note header) + N1
> N3 = roundup(n_descsz, WS)
> N4 = sizeof(elf note header) + N1 + N2
>
> The elf note header contains three 32-bit values on 32-bit and 64-bit systems. 
> The header is followed by name and desc data together with padding. The 
> alignment and padding varies depending on the word size.

I see your point and I disagree.  The notes in a kernel generated 
core dump do not vary in size.  Find me some implementation evidence that
anyone ever added the extra 4 bytes of alignment to the description and the
padding fields and I will be ready to consider this.  Currently this
just appears to be reading a draft spec that doesn't match reality.

Eric

  reply	other threads:[~2006-11-09 14:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02 10:19 [PATCH 01/02] Elf: Always define elf_addr_t in linux/elf.h Magnus Damm
2006-11-02 10:19 ` [PATCH 02/02] Elf: Align elf notes properly Magnus Damm
2006-11-09 14:00   ` Eric W. Biederman [this message]
2006-11-10  0:50     ` Horms
2006-11-10  4:00       ` Magnus Damm
2006-11-10 23:37         ` Jeremy Fitzhardinge
2006-11-10 23:39           ` David Miller
2006-11-11  0:26             ` Jeremy Fitzhardinge
2006-11-11  0:43               ` David Miller
2006-11-11  1:20                 ` Jeremy Fitzhardinge
2006-11-13  2:16                   ` Magnus Damm
2006-11-13  3:03                     ` Eric W. Biederman
2006-11-13  0:23                 ` Horms
2006-11-13  1:47                   ` David Miller
2006-11-10  3:52     ` Magnus Damm
2006-11-10  5:09       ` Eric W. Biederman
2006-11-10  6:53         ` Magnus Damm
2006-11-10 14:49           ` Vivek Goyal
2006-11-10 16:04             ` Dave Anderson
2006-11-10 16:10             ` Eric W. Biederman
2006-11-10 23:39         ` Jeremy Fitzhardinge
2006-11-02 10:43 ` [PATCH 01/02] Elf: Always define elf_addr_t in linux/elf.h Jakub Jelinek
2006-11-02 10:51   ` Magnus Damm

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=m1psbwzpmx.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@muc.de \
    --cc=anderson@redhat.com \
    --cc=fastboot@lists.osdl.org \
    --cc=horms@verge.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=magnus@valinux.co.jp \
    --cc=vgoyal@in.ibm.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