This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [x86-64 psABI] RFC: Extend x86-64 psABI to support x32
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: x32-abi at googlegroups dot com
- Cc: discuss at x86-64 dot org, GCC Development <gcc at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, GNU C Library <libc-alpha at sourceware dot org>, GDB <gdb at sourceware dot org>
- Date: Wed, 27 Jun 2012 05:01:44 -0700
- Subject: Re: [x86-64 psABI] RFC: Extend x86-64 psABI to support x32
- References: <CAMe9rOqE84CeCEZHxahccP2obgb50zdJWuY0z3UzWnDYn=g_4A@mail.gmail.com> <ccd4a6ab-f279-477f-b48b-94b8f4afd37d@googlegroups.com> <CAMe9rOqhnmcUhjO8SH6Ggz-VmyGFyuDrMHJU27HjKV+UM1RASA@mail.gmail.com> <69b1606d-6150-46eb-a426-93bfad19e7a2@googlegroups.com> <CAMe9rOpw=BczUuJrJxzE_JnnXe9br3H+-O+P4=u0Ce1Hs7KcAg@mail.gmail.com> <bde2af16-b04e-4e17-a22e-3fe0941e2496@googlegroups.com>
On Tue, Jun 26, 2012 at 10:56 PM, Mark Butler <butlerm@middle.net> wrote:
>
>
> On Tuesday, June 26, 2012 3:22:45 PM UTC-6, H.J. wrote:
>>
>> On Tue, Jun 26, 2012 at 2:11 PM, Mark Butler wrote:
>> >
>> >> x32 is designed to replace ia32 where long is 32-bit, not x86-64.
>> >>
>> > I understand, but wouldn't L64P32 be much better in the long run? In
>> > terms
>> > of compatibility with LP64, and an LP64 kernel in particular? ?The
>> > structure
>> > layouts of any structure that did not contain pointers would be
>> > identical,
>> > for example. ?struct timeval, struct timespec, struct stat, and on and
>> > on...
>>
>> Linux/x32 uses the same layout for struct timeval, struct timespec, struct
>> stat,
>> as Linux/x86-64. It is orthogonal to L64 vs L32.
>>
> If POSIX requires struct timespec to look like this:
>
> struct timespec {
> ? time_t tv_sec;
> ? long ? tv_nsec;
> }
>
> then how can an ABI with 32 bit longs have the same struct timespec layout
> as an ABI with 64 bit longs?
>
We changed it to
struct timespec
{
__time_t tv_sec; /* Seconds. */
__syscall_slong_t tv_nsec; /* Nanoseconds. */
};
--
H.J.