This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [x86-64 psABI] RFC: Extend x86-64 psABI to support x32


On Wed, Jun 27, 2012 at 07:39:37PM -0400, Rich Felker wrote:
> Really all of these should be fixed at the kernel level, i.e. the
> struct in the ABI should keep the same layout, but should be changed
> to a 32-bit value field and a 32-bit padding field where the kernel
> ignores the padding part.
> 
> Equivalently, the kernel headers could be left alone and just the user
> headers changed as long as the kernel masks off the high bits before
> using it...

Also, if the structure is fixed-size (as opposed to cmsghdr which is a
much bigger problem), the wrapper in libc can just make a copy of the
struct with the padding field filled with zeros to satisfy both POSIX
and Linux. This is what we do in musl libc, but I haven't found a way
to deal with the cmsghdr issue yet since it's in an arbitrary-size
block that is not necessarily copyable.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]