|
|
97d77c |
Date: Wed, 20 Nov 2013 18:05:21 +1030
|
|
|
97d77c |
From: Alan Modra <amodra at gmail dot com>
|
|
|
97d77c |
To: libffi-discuss at sourceware dot org
|
|
|
97d77c |
Subject: PowerPC64 ELFv2 fix 2 of 2
|
|
|
97d77c |
Message-ID: <20131120073521.GG22514@bubble.grove.modra.org>
|
|
|
97d77c |
References: <20131117031650.GR22514@bubble.grove.modra.org> <87eh6e2b4o.fsf@redhat.com> <20131119001430.GX22514@bubble.grove.modra.org>
|
|
|
97d77c |
MIME-Version: 1.0
|
|
|
97d77c |
Content-Type: text/plain; charset=us-ascii
|
|
|
97d77c |
Content-Disposition: inline
|
|
|
97d77c |
In-Reply-To: <20131119001430 dot GX22514 at bubble dot grove dot modra dot org>
|
|
|
97d77c |
User-Agent: Mutt/1.5.21 (2010-09-15)
|
|
|
97d77c |
|
|
|
97d77c |
Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
|
|
|
97d77c |
that a parameter save area could be allocated before it was strictly
|
|
|
97d77c |
necessary. Wrong but harmless. Found when splitting apart ffi.c
|
|
|
97d77c |
into 32-bit and 64-bit support.
|
|
|
97d77c |
|
|
|
97d77c |
* src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use
|
|
|
97d77c |
NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their
|
|
|
97d77c |
32-bit versions for 64-bit code.
|
|
|
97d77c |
|
|
|
97d77c |
diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c
|
|
|
97d77c |
index feb2144..6896065 100644
|
|
|
97d77c |
--- a/src/powerpc/ffi.c
|
|
|
97d77c |
+++ b/src/powerpc/ffi.c
|
|
|
97d77c |
@@ -978,7 +978,7 @@ ffi_prep_cif_machdep_core (ffi_cif *cif)
|
|
|
97d77c |
case FFI_TYPE_LONGDOUBLE:
|
|
|
97d77c |
fparg_count += 2;
|
|
|
97d77c |
intarg_count += 2;
|
|
|
97d77c |
- if (fparg_count > NUM_FPR_ARG_REGISTERS)
|
|
|
97d77c |
+ if (fparg_count > NUM_FPR_ARG_REGISTERS64)
|
|
|
97d77c |
flags |= FLAG_ARG_NEEDS_PSAVE;
|
|
|
97d77c |
break;
|
|
|
97d77c |
#endif
|
|
|
97d77c |
@@ -986,7 +986,7 @@ ffi_prep_cif_machdep_core (ffi_cif *cif)
|
|
|
97d77c |
case FFI_TYPE_DOUBLE:
|
|
|
97d77c |
fparg_count++;
|
|
|
97d77c |
intarg_count++;
|
|
|
97d77c |
- if (fparg_count > NUM_FPR_ARG_REGISTERS)
|
|
|
97d77c |
+ if (fparg_count > NUM_FPR_ARG_REGISTERS64)
|
|
|
97d77c |
flags |= FLAG_ARG_NEEDS_PSAVE;
|
|
|
97d77c |
break;
|
|
|
97d77c |
|
|
|
97d77c |
@@ -1007,12 +1007,12 @@ ffi_prep_cif_machdep_core (ffi_cif *cif)
|
|
|
97d77c |
if (elt)
|
|
|
97d77c |
{
|
|
|
97d77c |
fparg_count += elnum;
|
|
|
97d77c |
- if (fparg_count > NUM_FPR_ARG_REGISTERS)
|
|
|
97d77c |
+ if (fparg_count > NUM_FPR_ARG_REGISTERS64)
|
|
|
97d77c |
flags |= FLAG_ARG_NEEDS_PSAVE;
|
|
|
97d77c |
}
|
|
|
97d77c |
else
|
|
|
97d77c |
{
|
|
|
97d77c |
- if (intarg_count > NUM_GPR_ARG_REGISTERS)
|
|
|
97d77c |
+ if (intarg_count > NUM_GPR_ARG_REGISTERS64)
|
|
|
97d77c |
flags |= FLAG_ARG_NEEDS_PSAVE;
|
|
|
97d77c |
}
|
|
|
97d77c |
break;
|
|
|
97d77c |
@@ -1030,7 +1030,7 @@ ffi_prep_cif_machdep_core (ffi_cif *cif)
|
|
|
97d77c |
/* Everything else is passed as a 8-byte word in a GPR, either
|
|
|
97d77c |
the object itself or a pointer to it. */
|
|
|
97d77c |
intarg_count++;
|
|
|
97d77c |
- if (intarg_count > NUM_GPR_ARG_REGISTERS)
|
|
|
97d77c |
+ if (intarg_count > NUM_GPR_ARG_REGISTERS64)
|
|
|
97d77c |
flags |= FLAG_ARG_NEEDS_PSAVE;
|
|
|
97d77c |
break;
|
|
|
97d77c |
default:
|
|
|
97d77c |
|
|
|
97d77c |
--
|
|
|
97d77c |
Alan Modra
|
|
|
97d77c |
Australia Development Lab, IBM
|
|
|
97d77c |
|