[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090203112105.GD11926@shareable.org>
Date: Tue, 3 Feb 2009 11:21:05 +0000
From: Jamie Lokier <jamie@...reable.org>
To: Boaz Harrosh <bharrosh@...asas.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Arnd Bergmann <arnd@...db.de>,
Christoph Hellwig <hch@...radead.org>,
Eric Sandeen <sandeen@...deen.net>, mfasheh@...e.com,
joel.becker@...cle.com, linux-kernel@...r.kernel.org,
xfs-masters@....sgi.com, viro@...iv.linux.org.uk,
Ankit Jain <me@...itjain.org>, linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, xfs@....sgi.com,
ocfs2-devel@....oracle.com
Subject: Re: [xfs-masters] [PATCH] fs: Add new pre-allocation ioctls to vfs for compatibility with legacy xfs ioctls
Boaz Harrosh wrote:
> I would at least expect a big fat comment explaining what happened to the
> structure on what known ARCHs, and how it is expected to look in memory.
> And a BUILD_BUG_ON to make sure of that.
You may have a point.
Struct layout on some architectures changes between compiler default
ABIs in these implicit-padding cases. Kernel binary compatibility
will be affected. It is a good reason why we have explicit padding to
natural alignment normally.
>From http://wiki.debian.org/ArmEabiPort
"With the new ABI, default structure packing changes, as do some
default data sizes and alignment (which also have a knock-on effect on
structure packing). In particular the minimum size and alignment of a
structure was 4 bytes. Under the EABI there is no minimum and the
alignment is determined by the types of the components it
contains. This will break programs that know too much about the way
structures are packed and can break code that writes binary files by
dumping and reading structures."
"One of the key differences between the traditional GNU/Linux ABI
and the EABI is that 64-bit types (like long long) are aligned
differently. In the traditional ABI, these types had 4-byte alignment;
in the EABI they have 8-byte alignment. As a result, if you use the
same structure definitions (in a header file) and include it in code
used in both the kernel and in application code, you may find that the
structure size and alignment differ."
-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists