From 7446546ab02823b356570bf5b4280375fd646f99 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Thu, 4 Jun 2009 15:43:03 +0000 Subject: [multiple changes] 2009-06-04 Andrew Haley * src/powerpc/ppc_closure.S: Insert licence header. * src/powerpc/linux64_closure.S: Likewise. * src/m68k/sysv.S: Likewise. * src/sh64/ffi.c: Change void (*)() to void (*)(void). * src/powerpc/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/m32r/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/x86/ffi64.c: Likewise. * src/alpha/ffi.c: Likewise. * src/alpha/osf.S: Likewise. * src/frv/ffi.c: Likewise. * src/s390/ffi.c: Likewise. * src/pa/ffi.c: Likewise. * src/pa/hpux32.S: Likewise. * src/ia64/unix.S: Likewise. * src/ia64/ffi.c: Likewise. * src/sparc/ffi.c: Likewise. * src/mips/ffi.c: Likewise. * src/sh/ffi.c: Likewise. 2008-02-15 David Daney * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): Define (conditionally), and use it to include cachectl.h. (ffi_prep_closure_loc): Fix cache flushing. * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. From-SVN: r148172 --- libffi/ChangeLog | 31 +++++++++++++++++++++++++++++++ libffi/src/alpha/ffi.c | 6 +++--- libffi/src/alpha/osf.S | 4 ++-- libffi/src/arm/ffi.c | 6 +++--- libffi/src/arm/sysv.S | 2 +- libffi/src/frv/ffi.c | 7 ++++--- libffi/src/ia64/ffi.c | 6 +++--- libffi/src/ia64/unix.S | 8 ++++++-- libffi/src/java_raw_api.c | 4 ++-- libffi/src/m32r/ffi.c | 5 +++-- libffi/src/m68k/sysv.S | 23 ++++++++++++++++++++++- libffi/src/mips/ffi.c | 24 +++++++++++++++++++----- libffi/src/mips/ffitarget.h | 13 +++++++++++++ libffi/src/pa/ffi.c | 5 +++-- libffi/src/pa/hpux32.S | 3 ++- libffi/src/pa/linux.S | 3 ++- libffi/src/powerpc/ffi.c | 7 ++++--- libffi/src/powerpc/ffi_darwin.c | 6 +++--- libffi/src/powerpc/linux64.S | 5 +++++ libffi/src/powerpc/linux64_closure.S | 30 ++++++++++++++++++++++++++++++ libffi/src/powerpc/ppc_closure.S | 26 ++++++++++++++++++++++++++ libffi/src/raw_api.c | 6 ++---- libffi/src/s390/ffi.c | 5 +++-- libffi/src/s390/sysv.S | 1 + libffi/src/sh/ffi.c | 8 ++++---- libffi/src/sh64/ffi.c | 20 +++++++++++++++----- libffi/src/sparc/ffi.c | 8 ++++---- libffi/src/sparc/v8.S | 2 +- libffi/src/sparc/v9.S | 2 +- libffi/src/x86/darwin64.S | 3 ++- libffi/src/x86/ffi64.c | 5 +++-- libffi/src/x86/sysv.S | 3 +-- libffi/src/x86/unix64.S | 5 +++-- 33 files changed, 227 insertions(+), 65 deletions(-) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 6d3e071..7f7d128 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,5 +1,36 @@ 2009-06-04 Andrew Haley + * src/powerpc/ppc_closure.S: Insert licence header. + * src/powerpc/linux64_closure.S: Likewise. + * src/m68k/sysv.S: Likewise. + + * src/sh64/ffi.c: Change void (*)() to void (*)(void). + * src/powerpc/ffi.c: Likewise. + * src/powerpc/ffi_darwin.c: Likewise. + * src/m32r/ffi.c: Likewise. + * src/sh64/ffi.c: Likewise. + * src/x86/ffi64.c: Likewise. + * src/alpha/ffi.c: Likewise. + * src/alpha/osf.S: Likewise. + * src/frv/ffi.c: Likewise. + * src/s390/ffi.c: Likewise. + * src/pa/ffi.c: Likewise. + * src/pa/hpux32.S: Likewise. + * src/ia64/unix.S: Likewise. + * src/ia64/ffi.c: Likewise. + * src/sparc/ffi.c: Likewise. + * src/mips/ffi.c: Likewise. + * src/sh/ffi.c: Likewise. + +2008-02-15 David Daney + + * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): + Define (conditionally), and use it to include cachectl.h. + (ffi_prep_closure_loc): Fix cache flushing. + * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. + +2009-06-04 Andrew Haley + include/ffi.h.in, src/arm/ffitarget.h, src/arm/ffi.c, diff --git a/libffi/src/alpha/ffi.c b/libffi/src/alpha/ffi.c index eb8dfca..8d6b2ba 100644 --- a/libffi/src/alpha/ffi.c +++ b/libffi/src/alpha/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998, 2001, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc. Alpha Foreign Function Interface @@ -39,7 +39,7 @@ # define FFI_TYPE_LONGDOUBLE 4 #endif -extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)()) +extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void)) FFI_HIDDEN; extern void ffi_closure_osf(void) FFI_HIDDEN; @@ -76,7 +76,7 @@ ffi_prep_cif_machdep(ffi_cif *cif) void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { unsigned long *stack, *argp; long i, avn; diff --git a/libffi/src/alpha/osf.S b/libffi/src/alpha/osf.S index 0e70128..d0e7782 100644 --- a/libffi/src/alpha/osf.S +++ b/libffi/src/alpha/osf.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - osf.S - Copyright (c) 1998, 2001, 2007 Red Hat + osf.S - Copyright (c) 1998, 2001, 2007, 2008 Red Hat Alpha/OSF Foreign Function Interface @@ -32,7 +32,7 @@ .text /* ffi_call_osf (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)()); + void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also diff --git a/libffi/src/arm/ffi.c b/libffi/src/arm/ffi.c index 0149662..f6a6475 100644 --- a/libffi/src/arm/ffi.c +++ b/libffi/src/arm/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998 Red Hat, Inc. + ffi.c - Copyright (c) 1998, 2008 Red Hat, Inc. ARM Foreign Function Interface @@ -149,9 +149,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) } extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)()); + unsigned, unsigned, unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S index 1c1883b..34481c8 100644 --- a/libffi/src/arm/sysv.S +++ b/libffi/src/arm/sysv.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998 Red Hat, Inc. + sysv.S - Copyright (c) 1998, 2008 Red Hat, Inc. ARM Foreign Function Interface diff --git a/libffi/src/frv/ffi.c b/libffi/src/frv/ffi.c index b79e990..5698c89 100644 --- a/libffi/src/frv/ffi.c +++ b/libffi/src/frv/ffi.c @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2004 Anthony Green + ffi.c - Copyright (C) 2004 Anthony Green Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2008 Red Hat, Inc. FR-V Foreign Function Interface @@ -126,10 +127,10 @@ extern void ffi_call_EABI(void *(*)(char *, extended_cif *), extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)()); + void (*fn)(void)); void ffi_call(ffi_cif *cif, - void (*fn)(), + void (*fn)(void), void *rvalue, void **avalue) { diff --git a/libffi/src/ia64/ffi.c b/libffi/src/ia64/ffi.c index 77e8631..3f8fcc5 100644 --- a/libffi/src/ia64/ffi.c +++ b/libffi/src/ia64/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1998, 2007, 2008 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64 Foreign Function Interface @@ -270,10 +270,10 @@ ffi_prep_cif_machdep(ffi_cif *cif) return FFI_OK; } -extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(), UINT64); +extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(void), UINT64); void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { struct ia64_args *stack; long i, avn, gpcount, fpcount; diff --git a/libffi/src/ia64/unix.S b/libffi/src/ia64/unix.S index 1d5023f..4d2a86d 100644 --- a/libffi/src/ia64/unix.S +++ b/libffi/src/ia64/unix.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - unix.S - Copyright (c) 1998 Red Hat, Inc. + unix.S - Copyright (c) 1998, 2008 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64/unix Foreign Function Interface @@ -38,7 +38,7 @@ .text /* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue, - void (*fn)(), int flags); + void (*fn)(void), int flags); */ .align 16 @@ -554,3 +554,7 @@ ffi_closure_unix: data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/java_raw_api.c b/libffi/src/java_raw_api.c index 4778bf3..1f8f983 100644 --- a/libffi/src/java_raw_api.c +++ b/libffi/src/java_raw_api.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - java_raw_api.c - Copyright (c) 1999, 2007 Red Hat, Inc. + java_raw_api.c - Copyright (c) 1999, 2007, 2008 Red Hat, Inc. Cloned from raw_api.c @@ -295,7 +295,7 @@ ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) * these following couple of functions will handle the translation forth * and back automatically. */ -void ffi_java_raw_call (ffi_cif *cif, void (*fn)(), void *rvalue, +void ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_java_raw *raw) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); diff --git a/libffi/src/m32r/ffi.c b/libffi/src/m32r/ffi.c index c3e8204..3000063 100644 --- a/libffi/src/m32r/ffi.c +++ b/libffi/src/m32r/ffi.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2004 Renesas Technology + Copyright (c) 2008 Red Hat, Inc. M32R Foreign Function Interface @@ -172,9 +173,9 @@ ffi_prep_cif_machdep(ffi_cif *cif) } extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)()); + unsigned, unsigned, unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; diff --git a/libffi/src/m68k/sysv.S b/libffi/src/m68k/sysv.S index 3face83..58822e0 100644 --- a/libffi/src/m68k/sysv.S +++ b/libffi/src/m68k/sysv.S @@ -1,7 +1,28 @@ /* ----------------------------------------------------------------------- - sysv.S + sysv.S - Copyright (c) 1998 Andreas Schwab + Copyright (c) 2008 Red Hat, Inc. m68k Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM diff --git a/libffi/src/mips/ffi.c b/libffi/src/mips/ffi.c index f21182b..b6887be 100644 --- a/libffi/src/mips/ffi.c +++ b/libffi/src/mips/ffi.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1996, 2007, 2008 Red Hat, Inc. + Copyright (c) 2008 David Daney MIPS Foreign Function Interface @@ -29,6 +30,16 @@ #include +#ifdef __GNUC__ +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) +# define USE__BUILTIN___CLEAR_CACHE 1 +# endif +#endif + +#ifndef USE__BUILTIN___CLEAR_CACHE +#include +#endif + #ifdef FFI_DEBUG # define FFI_MIPS_STOP_HERE() ffi_stop_here() #else @@ -483,14 +494,14 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) /* Low level routine for calling O32 functions */ extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int), extended_cif *, unsigned, - unsigned, unsigned *, void (*)()); + unsigned, unsigned *, void (*)(void)); /* Low level routine for calling N32 functions */ extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int), extended_cif *, unsigned, - unsigned, unsigned *, void (*)()); + unsigned, unsigned *, void (*)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; @@ -616,8 +627,11 @@ ffi_prep_closure_loc (ffi_closure *closure, closure->fun = fun; closure->user_data = user_data; +#ifdef USE__BUILTIN___CLEAR_CACHE __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); - +#else + cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); +#endif return FFI_OK; } diff --git a/libffi/src/mips/ffitarget.h b/libffi/src/mips/ffitarget.h index bbc95c3..214afe4 100644 --- a/libffi/src/mips/ffitarget.h +++ b/libffi/src/mips/ffitarget.h @@ -27,6 +27,19 @@ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H +#ifdef linux +#include +# ifndef _ABIN32 +# define _ABIN32 _MIPS_SIM_NABI32 +# endif +# ifndef _ABI64 +# define _ABI64 _MIPS_SIM_ABI64 +# endif +# ifndef _ABIO32 +# define _ABIO32 _MIPS_SIM_ABI32 +# endif +#endif + #if !defined(_MIPS_SIM) -- something is very wrong -- #else diff --git a/libffi/src/pa/ffi.c b/libffi/src/pa/ffi.c index bb5dd22..c7a1435 100644 --- a/libffi/src/pa/ffi.c +++ b/libffi/src/pa/ffi.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - (c) 2003-2004 Randolph Chung + (c) 2008 Red Hat, Inc. HPPA Foreign Function Interface HP-UX PA ABI support (c) 2006 Free Software Foundation, Inc. @@ -368,9 +369,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned), extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)()); + void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; diff --git a/libffi/src/pa/hpux32.S b/libffi/src/pa/hpux32.S index 8f6b461..40528ba 100644 --- a/libffi/src/pa/hpux32.S +++ b/libffi/src/pa/hpux32.S @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- hpux32.S - Copyright (c) 2006 Free Software Foundation, Inc. + (c) 2008 Red Hat, Inc. based on src/pa/linux.S HP-UX PA Foreign Function Interface @@ -40,7 +41,7 @@ unsigned bytes, unsigned flags, unsigned *rvalue, - void (*fn)()); + void (*fn)(void)); */ .export ffi_call_pa32,ENTRY,PRIV_LEV=3 diff --git a/libffi/src/pa/linux.S b/libffi/src/pa/linux.S index 4407f65..f11ae76 100644 --- a/libffi/src/pa/linux.S +++ b/libffi/src/pa/linux.S @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- linux.S - (c) 2003-2004 Randolph Chung + (c) 2008 Red Hat, Inc. HPPA Foreign Function Interface @@ -36,7 +37,7 @@ unsigned bytes, unsigned flags, unsigned *rvalue, - void (*fn)()); + void (*fn)(void)); */ .export ffi_call_pa32,code diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c index 73c1dd2..a0426f4 100644 --- a/libffi/src/powerpc/ffi.c +++ b/libffi/src/powerpc/ffi.c @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Geoffrey Keating Copyright (C) 2007, 2008 Free Software Foundation, Inc + Copyright (C) 2008 Red Hat, Inc PowerPC Foreign Function Interface @@ -875,13 +876,13 @@ ffi_prep_cif_machdep (ffi_cif *cif) } extern void ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)()); + void (*fn)(void)); extern void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long, unsigned long *, - void (*fn)()); + void (*fn)(void)); void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; diff --git a/libffi/src/powerpc/ffi_darwin.c b/libffi/src/powerpc/ffi_darwin.c index 6d1b73e..501035d 100644 --- a/libffi/src/powerpc/ffi_darwin.c +++ b/libffi/src/powerpc/ffi_darwin.c @@ -425,11 +425,11 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) } extern void ffi_call_AIX(extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)(), void (*fn2)()); + void (*fn)(void), void (*fn2)(void)); extern void ffi_call_DARWIN(extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)(), void (*fn2)()); + void (*fn)(void), void (*fn2)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S index 14e6a69..57b56cb 100644 --- a/libffi/src/powerpc/linux64.S +++ b/libffi/src/powerpc/linux64.S @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. PowerPC64 Assembly glue. @@ -180,3 +181,7 @@ ffi_call_LINUX64: .align 3 .LEFDE1: #endif + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S index b19bc71..f7aa2c9 100644 --- a/libffi/src/powerpc/linux64_closure.S +++ b/libffi/src/powerpc/linux64_closure.S @@ -1,3 +1,29 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC64 Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include @@ -204,3 +230,7 @@ ffi_closure_LINUX64: .align 3 .LEFDE1: #endif + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/powerpc/ppc_closure.S b/libffi/src/powerpc/ppc_closure.S index f65784b..56f7d1a 100644 --- a/libffi/src/powerpc/ppc_closure.S +++ b/libffi/src/powerpc/ppc_closure.S @@ -1,3 +1,29 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include diff --git a/libffi/src/raw_api.c b/libffi/src/raw_api.c index 00f02b2..ce21372 100644 --- a/libffi/src/raw_api.c +++ b/libffi/src/raw_api.c @@ -1,10 +1,8 @@ /* ----------------------------------------------------------------------- - raw_api.c - Copyright (c) 1999 Red Hat, Inc. + raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc. Author: Kresten Krab Thorup - $Id $ - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including @@ -190,7 +188,7 @@ ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) * these following couple of functions will handle the translation forth * and back automatically. */ -void ffi_raw_call (ffi_cif *cif, void (*fn)(), void *rvalue, ffi_raw *raw) +void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); ffi_raw_to_ptrarray (cif, raw, avalue); diff --git a/libffi/src/s390/ffi.c b/libffi/src/s390/ffi.c index d17f790..ca2675b 100644 --- a/libffi/src/s390/ffi.c +++ b/libffi/src/s390/ffi.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2000, 2007 Software AG + Copyright (c) 2008 Red Hat, Inc S390 Foreign Function Interface @@ -88,7 +89,7 @@ extern void ffi_call_SYSV(unsigned, void (*)(unsigned char *, extended_cif *), unsigned, void *, - void (*fn)()); + void (*fn)(void)); extern void ffi_closure_SYSV(void); @@ -498,7 +499,7 @@ ffi_prep_cif_machdep(ffi_cif *cif) void ffi_call(ffi_cif *cif, - void (*fn)(), + void (*fn)(void), void *rvalue, void **avalue) { diff --git a/libffi/src/s390/sysv.S b/libffi/src/s390/sysv.S index db70e60..4731a31 100644 --- a/libffi/src/s390/sysv.S +++ b/libffi/src/s390/sysv.S @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2000 Software AG + Copyright (c) 2008 Red Hat, Inc. S390 Foreign Function Interface diff --git a/libffi/src/sh/ffi.c b/libffi/src/sh/ffi.c index 330cb7e..69bd025 100644 --- a/libffi/src/sh/ffi.c +++ b/libffi/src/sh/ffi.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 - Kaz Kojima + ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Kaz Kojima + Copyright (c) 2008 Red Hat, Inc. SuperH Foreign Function Interface @@ -407,9 +407,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) } extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)()); + unsigned, unsigned, unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; UINT64 trvalue; diff --git a/libffi/src/sh64/ffi.c b/libffi/src/sh64/ffi.c index 4e6bd1b..8fbc05c 100644 --- a/libffi/src/sh64/ffi.c +++ b/libffi/src/sh64/ffi.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2003, 2004, 2006, 2007 Kaz Kojima + Copyright (c) 2008 Anthony Green SuperH SHmedia Foreign Function Interface @@ -237,11 +238,20 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) return FFI_OK; } -extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, long long, unsigned *, - void (*fn)()); - -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +/*@-declundef@*/ +/*@-exportheader@*/ +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, long long, + /*@out@*/ unsigned *, + void (*fn)(void)); +/*@=declundef@*/ +/*@=exportheader@*/ + +void ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(void), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue) { extended_cif ecif; UINT64 trvalue; diff --git a/libffi/src/sparc/ffi.c b/libffi/src/sparc/ffi.c index 55b3b23..3b73f0c 100644 --- a/libffi/src/sparc/ffi.c +++ b/libffi/src/sparc/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996, 2003, 2004, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1996, 2003, 2004, 2007, 2008 Red Hat, Inc. SPARC Foreign Function Interface @@ -369,13 +369,13 @@ int ffi_v9_layout_struct(ffi_type *arg, int off, char *ret, char *intg, char *fl #ifdef SPARC64 extern int ffi_call_v9(void *, extended_cif *, unsigned, - unsigned, unsigned *, void (*fn)()); + unsigned, unsigned *, void (*fn)(void)); #else extern int ffi_call_v8(void *, extended_cif *, unsigned, - unsigned, unsigned *, void (*fn)()); + unsigned, unsigned *, void (*fn)(void)); #endif -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; void *rval = rvalue; diff --git a/libffi/src/sparc/v8.S b/libffi/src/sparc/v8.S index 9e26bc7..2c4eb60 100644 --- a/libffi/src/sparc/v8.S +++ b/libffi/src/sparc/v8.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - v8.S - Copyright (c) 1996, 1997, 2003, 2004 Red Hat, Inc. + v8.S - Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc. SPARC Foreign Function Interface diff --git a/libffi/src/sparc/v9.S b/libffi/src/sparc/v9.S index a904b07..489ff02 100644 --- a/libffi/src/sparc/v9.S +++ b/libffi/src/sparc/v9.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - v9.S - Copyright (c) 2000, 2003, 2004 Red Hat, Inc. + v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc. SPARC 64-bit Foreign Function Interface diff --git a/libffi/src/x86/darwin64.S b/libffi/src/x86/darwin64.S index 5ba0a5f..2f7394e 100644 --- a/libffi/src/x86/darwin64.S +++ b/libffi/src/x86/darwin64.S @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc. + Copyright (c) 2008 Red Hat, Inc. derived from unix64.S x86-64 Foreign Function Interface for Darwin. @@ -33,7 +34,7 @@ .text /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)()); + void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also diff --git a/libffi/src/x86/ffi64.c b/libffi/src/x86/ffi64.c index 5162f69..2896ae4 100644 --- a/libffi/src/x86/ffi64.c +++ b/libffi/src/x86/ffi64.c @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2002, 2007 Bo Thorsen + Copyright (c) 2008 Red Hat, Inc. x86-64 Foreign Function Interface @@ -43,7 +44,7 @@ struct register_args }; extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)(), unsigned ssecount); + void *raddr, void (*fnaddr)(void), unsigned ssecount); /* All reference to register classes here is identical to the code in gcc/config/i386/i386.c. Do *not* change one without the other. */ @@ -340,7 +341,7 @@ ffi_prep_cif_machdep (ffi_cif *cif) } void -ffi_call (ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { enum x86_64_reg_class classes[MAX_CLASSES]; char *stack, *argp; diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S index d81ba48..f4b6c1e 100644 --- a/libffi/src/x86/sysv.S +++ b/libffi/src/x86/sysv.S @@ -1,6 +1,5 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005, 2008 - Red Hat, Inc. + sysv.S - Copyright (c) 1996, 1998, 2001-2003, 2005, 2008 Red Hat, Inc. X86 Foreign Function Interface diff --git a/libffi/src/x86/unix64.S b/libffi/src/x86/unix64.S index 3e31abc..fe3f4fd 100644 --- a/libffi/src/x86/unix64.S +++ b/libffi/src/x86/unix64.S @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- - unix64.S - Copyright (c) 2002, 2008 Bo Thorsen + unix64.S - Copyright (c) 2002 Bo Thorsen + Copyright (c) 2008 Red Hat, Inc x86-64 Foreign Function Interface @@ -32,7 +33,7 @@ .text /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)()); + void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also -- cgit v1.1