From: Vivek Goyal <vgoyal@in.ibm.com>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Magnus Damm <magnus@valinux.co.jp>,
linux-kernel@vger.kernel.org, Vivek Goyal <vgoyal@in.ibm.com>,
Andi Kleen <ak@muc.de>,
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: Fri, 10 Nov 2006 09:49:22 -0500 [thread overview]
Message-ID: <20061110144922.GA8155@in.ibm.com> (raw)
In-Reply-To: <aec7e5c30611092253q6bd15701x1f5da122de5c7075@mail.gmail.com>
On Fri, Nov 10, 2006 at 03:53:57PM +0900, Magnus Damm wrote:
[..]
> >Sure.
> >
> >To verify your claim that 8 byte alignment is correct I checked the
> >core dump code in fs/binfmt_elf.c in the linux kernel. That always
> >uses 4 byte alignment. Therefore it appears clear that only doing
> >4 byte alignment is not a local misreading of the spec, and is used in
> >other implementations. If you can find an implementation that uses
> >8 byte alignment I am willing to consider it.
>
> Yes, fs/binfmt_elf.c is one of the files that my patch modifies. There
> are several elf note implementations in the kernel, all seem to use
> 4-byte aligment.
>
> Implementations that use 8-byte alignment:
>
> binutils-2.16.1/bfd/elf.c: elf_core_write_note() is using
> log_file_align which is set to 3 on some 64-bit platforms. 8-byte
> alignment in some cases.
>
> binutils-2.16.1/binutils/readelf.c: process_corefile_note_segment() is
> always using 4-byte alignment though.
>
> >The current situation is that the linux kernel generated application
> >core dumps use 4 byte alignment so I expect that is what existing
> >applications such as gdb expect.
>
> Most applications probably expect 4-byte aligned data. OTOH, I just
> came across HP's ELF-64 Object File Format document. It says that
> 8-byte alignment should be used:
>
> http://devresource.hp.com/drc/STK/docs/refs/elf-64-hp.pdf
>
> So now we have two documents that say 8-byte alignment should be used.
>
> >Therefore we use 4 byte alignment unless it can be shown that the
> >linux core dumps are a fluke and should be fixed.
>
> Ok. Vivek, Dave, anyone? Comments?
>
IMHO, I think we should go by the specs (8byte boundary alignment on 64bit
platforms) until and unless it can be proven that specs are wrong. This
probably will mean that we will break things for sometime (until and unless
it is fixed in tool chain and probably will also break the capability to use
an older kernel for capturing dump). But that's unavoidable if we want to be
compliant to specs.
Thanks
Vivek
next prev parent reply other threads:[~2006-11-10 14:50 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
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 [this message]
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=20061110144922.GA8155@in.ibm.com \
--to=vgoyal@in.ibm.com \
--cc=ak@muc.de \
--cc=anderson@redhat.com \
--cc=ebiederm@xmission.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 \
/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