Re: [PATCH 02/02] Elf: Align elf notes properly

From: Eric W. Biederman
Date: Fri Nov 10 2006 - 11:13:32 EST


Vivek Goyal <vgoyal@xxxxxxxxxx> writes:
>
> 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.

I just looked a little more, and the notes gcc generates on x86_64 are only 4
byte aligned. (.note.ABI-tag)

The linux kernel gcc, gdb. I think that is enough to say that notes need to
be 4 byte aligned on Linux. The core ELF spec also calls out 4 byte alignment
(although it does not mention ELFCLASS64).

I think the evidence is that someone intended to the alignment to go to 8 bytes
with the move to 64bits but it did not catch on in the real world.

So yes I believe the evidence is quite strong that the spec is wrong.
(Not on some rare platforms certainly but in general).

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/