This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Byte swapping support
> Was this considered significantly more complex because of the need to
> discriminate between native and reverse order? Or do you expect similar
> complexity even if this is not required (see my comment below)?
The former.
> I don't. The idea is to reverse scalar storage order for the whole
> userspace process and then add byte swapping to the Linux kernel when
> accessing userspace memory. This keeps userspace memory consistent
> with regards to endianness, which should lead to high compatibility
> with big-endian applications. Userspace memory access from the kernel
> always uses a small set of helper functions, which should make it
> easier to insert byte swapping at appropriate places.
Well, if your userspace is entirely in reverse order, then of course things
are totally different and I suspect that you'll pay the price in term of run
time performance. This is not what the attribute was designed for, although
we added the -fsso-struct switch at some point.
--
Eric Botcazou