ffi 1.1.2 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +456 -0
- data/COPYING +49 -0
- data/Gemfile +21 -0
- data/LICENSE +21 -11
- data/LICENSE.SPECS +22 -0
- data/README.md +137 -0
- data/Rakefile +166 -156
- data/ext/ffi_c/AbstractMemory.c +240 -140
- data/ext/ffi_c/AbstractMemory.h +25 -15
- data/ext/ffi_c/ArrayType.c +78 -29
- data/ext/ffi_c/ArrayType.h +22 -12
- data/ext/ffi_c/Buffer.c +121 -60
- data/ext/ffi_c/Call.c +184 -137
- data/ext/ffi_c/Call.h +46 -22
- data/ext/ffi_c/ClosurePool.c +101 -43
- data/ext/ffi_c/ClosurePool.h +24 -13
- data/ext/ffi_c/DynamicLibrary.c +139 -57
- data/ext/ffi_c/DynamicLibrary.h +70 -12
- data/ext/ffi_c/Function.c +372 -273
- data/ext/ffi_c/Function.h +25 -20
- data/ext/ffi_c/FunctionInfo.c +135 -49
- data/ext/ffi_c/LastError.c +97 -30
- data/ext/ffi_c/LastError.h +21 -12
- data/ext/ffi_c/LongDouble.c +15 -9
- data/ext/ffi_c/LongDouble.h +21 -16
- data/ext/ffi_c/MappedType.c +88 -38
- data/ext/ffi_c/MappedType.h +21 -14
- data/ext/ffi_c/MemoryPointer.c +91 -38
- data/ext/ffi_c/MemoryPointer.h +22 -19
- data/ext/ffi_c/MethodHandle.c +52 -51
- data/ext/ffi_c/MethodHandle.h +24 -14
- data/ext/ffi_c/Platform.c +28 -62
- data/ext/ffi_c/Platform.h +21 -12
- data/ext/ffi_c/Pointer.c +145 -86
- data/ext/ffi_c/Pointer.h +23 -19
- data/ext/ffi_c/Struct.c +363 -163
- data/ext/ffi_c/Struct.h +39 -21
- data/ext/ffi_c/StructByValue.c +72 -37
- data/ext/ffi_c/StructByValue.h +21 -12
- data/ext/ffi_c/StructLayout.c +308 -94
- data/ext/ffi_c/Thread.c +73 -270
- data/ext/ffi_c/Thread.h +32 -35
- data/ext/ffi_c/Type.c +147 -84
- data/ext/ffi_c/Type.h +27 -11
- data/ext/ffi_c/Types.c +40 -24
- data/ext/ffi_c/Types.h +24 -21
- data/ext/ffi_c/Variadic.c +148 -64
- data/ext/ffi_c/compat.h +45 -37
- data/ext/ffi_c/extconf.rb +86 -32
- data/ext/ffi_c/ffi.c +32 -21
- data/ext/ffi_c/libffi/.allow-ai-service +0 -0
- data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
- data/ext/ffi_c/libffi/.appveyor.yml +84 -0
- data/ext/ffi_c/libffi/.ci/ar-lib +270 -0
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/.ci/compile +351 -0
- data/ext/ffi_c/libffi/.ci/install.sh +78 -0
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/moxie-sim.exp +60 -0
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/site.exp +29 -0
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
- data/ext/ffi_c/libffi/.gitignore +46 -0
- data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6366 -3559
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
- data/ext/ffi_c/libffi/Makefile.am +131 -170
- data/ext/ffi_c/libffi/Makefile.in +1317 -1010
- data/ext/ffi_c/libffi/README.md +531 -0
- data/ext/ffi_c/libffi/acinclude.m4 +289 -4
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/compile +222 -17
- data/ext/ffi_c/libffi/config.guess +1033 -780
- data/ext/ffi_c/libffi/config.sub +1393 -1206
- data/ext/ffi_c/libffi/configure +16340 -10740
- data/ext/ffi_c/libffi/configure.ac +226 -271
- data/ext/ffi_c/libffi/configure.host +330 -4
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/Makefile.in +818 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +525 -79
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +41 -52
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +312 -0
- data/ext/ffi_c/libffi/include/Makefile.am +3 -3
- data/ext/ffi_c/libffi/include/Makefile.in +201 -79
- data/ext/ffi_c/libffi/include/ffi.h.in +190 -99
- data/ext/ffi_c/libffi/include/ffi_cfi.h +76 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +72 -14
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/install-sh +231 -210
- data/ext/ffi_c/libffi/libffi.map.in +81 -0
- data/ext/ffi_c/libffi/libffi.pc.in +3 -2
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
- data/ext/ffi_c/libffi/libtool-ldflags +106 -0
- data/ext/ffi_c/libffi/libtool-version +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +3868 -2068
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +47 -25
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +110 -147
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +75 -19
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +8 -29
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +11 -9
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +104 -52
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +18 -8
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.am +2 -2
- data/ext/ffi_c/libffi/man/Makefile.in +156 -57
- data/ext/ffi_c/libffi/man/ffi.3 +10 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
- data/ext/ffi_c/libffi/missing +153 -314
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/{include/ffi.h.vc64 → msvc_build/aarch64/aarch64_include/ffi.h} +151 -67
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +176 -20
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +1142 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +100 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +695 -0
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
- data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +161 -266
- data/ext/ffi_c/libffi/src/arc/arcompact.S +210 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +443 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +67 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +706 -513
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +32 -8
- data/ext/ffi_c/libffi/src/arm/internal.h +17 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +372 -413
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
- data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
- data/ext/ffi_c/libffi/src/closures.c +565 -73
- data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/debug.c +8 -3
- data/ext/ffi_c/libffi/src/dlmalloc.c +23 -13
- data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +47 -13
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +8 -2
- data/ext/ffi_c/libffi/src/ia64/unix.S +28 -3
- data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +32 -15
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
- data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
- data/ext/ffi_c/libffi/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
- data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +382 -101
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +23 -14
- data/ext/ffi_c/libffi/src/mips/n32.S +321 -89
- data/ext/ffi_c/libffi/src/mips/o32.S +211 -31
- data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
- data/ext/ffi_c/libffi/src/moxie/ffi.c +100 -66
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +341 -0
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +28 -12
- data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
- data/ext/ffi_c/libffi/src/powerpc/aix.S +245 -7
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +253 -4
- data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +105 -1378
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +157 -52
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +110 -45
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +191 -85
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +438 -108
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +131 -25
- data/ext/ffi_c/libffi/src/raw_api.c +18 -5
- data/ext/ffi_c/libffi/src/riscv/ffi.c +514 -0
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +9 -1
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
- data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +630 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
- data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
- data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
- data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/types.c +48 -19
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
- data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +686 -498
- data/ext/ffi_c/libffi/src/x86/ffi64.c +444 -129
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +79 -36
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +361 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +43 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +36 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1198 -394
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +585 -300
- data/ext/ffi_c/libffi/src/x86/win64.S +244 -458
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +306 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +57 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +268 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +80 -73
- data/ext/ffi_c/libffi/testsuite/Makefile.in +233 -117
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +360 -28
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +22 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1746 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +747 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +52 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +110 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +9 -10
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +140 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +13 -16
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +22 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +26 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +28 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +33 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +8 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +25 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +40 -8
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +17 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +23 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +17 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +17 -4
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +113 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +26 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +17 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +33 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +29 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +32 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +28 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +43 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +29 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +18 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +18 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +18 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +24 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +44 -31
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +44 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +22 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +22 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +22 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +22 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +7 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +19 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +14 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +32 -12
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +21 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +125 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +49 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +7 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +41 -40
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +38 -15
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +9 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +19 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +137 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +15 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +15 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +14 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +14 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +17 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +14 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +17 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +17 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +8 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +4 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +4 -2
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
- data/ext/ffi_c/libffi.bsd.mk +13 -7
- data/ext/ffi_c/libffi.darwin.mk +25 -13
- data/ext/ffi_c/libffi.gnu.mk +4 -3
- data/ext/ffi_c/libffi.mk +11 -6
- data/ext/ffi_c/libffi.vc.mk +1 -1
- data/ext/ffi_c/libffi.vc64.mk +1 -1
- data/ext/ffi_c/rbffi.h +23 -15
- data/ext/ffi_c/rbffi_endian.h +11 -2
- data/ffi.gemspec +42 -0
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +65 -68
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/dynamic_library.rb +118 -0
- data/lib/ffi/enum.rb +166 -25
- data/lib/ffi/errno.rb +21 -11
- data/lib/ffi/ffi.rb +28 -11
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/io.rb +25 -15
- data/lib/ffi/library.rb +227 -136
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +64 -35
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +175 -0
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -87
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- data/lib/ffi/platform/mips64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparcv9-linux/types.conf +102 -0
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +93 -63
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -88
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -87
- data/lib/ffi/platform/x86_64-openbsd/types.conf +100 -92
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
- data/lib/ffi/platform.rb +91 -34
- data/lib/ffi/pointer.rb +78 -33
- data/lib/ffi/struct.rb +100 -66
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +84 -19
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +48 -1
- data/lib/ffi/tools/generator_task.rb +13 -16
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +14 -10
- data/lib/ffi/types.rb +96 -51
- data/lib/ffi/union.rb +23 -12
- data/lib/ffi/variadic.rb +44 -29
- data/lib/ffi/version.rb +3 -0
- data/lib/ffi.rb +20 -8
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +8 -0
- data/samples/hello_ractor.rb +11 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +75 -0
- data/samples/qsort.rb +20 -0
- data/samples/qsort_ractor.rb +28 -0
- data/sig/ffi/abstract_memory.rbs +165 -0
- data/sig/ffi/auto_pointer.rbs +27 -0
- data/sig/ffi/buffer.rbs +18 -0
- data/sig/ffi/data_converter.rbs +10 -0
- data/sig/ffi/dynamic_library.rbs +9 -0
- data/sig/ffi/enum.rbs +38 -0
- data/sig/ffi/function.rbs +39 -0
- data/sig/ffi/library.rbs +42 -0
- data/sig/ffi/native_type.rbs +86 -0
- data/sig/ffi/pointer.rbs +42 -0
- data/sig/ffi/struct.rbs +76 -0
- data/sig/ffi/struct_by_reference.rbs +11 -0
- data/sig/ffi/struct_by_value.rbs +7 -0
- data/sig/ffi/struct_layout.rbs +9 -0
- data/sig/ffi/struct_layout_builder.rbs +5 -0
- data/sig/ffi/type.rbs +39 -0
- data/sig/ffi.rbs +26 -0
- data.tar.gz.sig +0 -0
- metadata +508 -268
- metadata.gz.sig +1 -0
- data/History.txt +0 -1
- data/README.rdoc +0 -102
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/Ffi_c.iml +0 -12
- data/ext/ffi_c/StructByReference.c +0 -158
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/libffi/Makefile.vc +0 -141
- data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
- data/ext/ffi_c/libffi/README +0 -342
- data/ext/ffi_c/libffi/aclocal.m4 +0 -1873
- data/ext/ffi_c/libffi/build-ios.sh +0 -67
- data/ext/ffi_c/libffi/depcomp +0 -630
- data/ext/ffi_c/libffi/doc/libffi.info +0 -593
- data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
- data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
- data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +0 -76
- data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7831
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -369
- data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
- data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -98
- data/ext/ffi_c/libffi/mdate-sh +0 -201
- data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
- data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
- data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
- data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
- data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
- data/ext/ffi_c/libffi/src/x86/win32.S +0 -1065
- data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
- data/ext/ffi_c/libffi/texinfo.tex +0 -7210
- data/ext/ffi_c/win32/stdint.h +0 -199
- data/gen/Rakefile +0 -30
- data/lib/Lib.iml +0 -13
- data/spec/ffi/Ffi.iml +0 -12
- data/spec/ffi/async_callback_spec.rb +0 -46
- data/spec/ffi/bool_spec.rb +0 -40
- data/spec/ffi/buffer_spec.rb +0 -215
- data/spec/ffi/callback_spec.rb +0 -668
- data/spec/ffi/custom_param_type.rb +0 -47
- data/spec/ffi/custom_type_spec.rb +0 -85
- data/spec/ffi/dup_spec.rb +0 -65
- data/spec/ffi/enum_spec.rb +0 -227
- data/spec/ffi/errno_spec.rb +0 -29
- data/spec/ffi/ffi_spec.rb +0 -40
- data/spec/ffi/function_spec.rb +0 -87
- data/spec/ffi/library_spec.rb +0 -208
- data/spec/ffi/long_double.rb +0 -41
- data/spec/ffi/managed_struct_spec.rb +0 -72
- data/spec/ffi/number_spec.rb +0 -247
- data/spec/ffi/pointer_spec.rb +0 -214
- data/spec/ffi/rbx/attach_function_spec.rb +0 -28
- data/spec/ffi/rbx/memory_pointer_spec.rb +0 -111
- data/spec/ffi/rbx/spec_helper.rb +0 -1
- data/spec/ffi/rbx/struct_spec.rb +0 -13
- data/spec/ffi/spec_helper.rb +0 -35
- data/spec/ffi/string_spec.rb +0 -119
- data/spec/ffi/strptr_spec.rb +0 -61
- data/spec/ffi/struct_callback_spec.rb +0 -80
- data/spec/ffi/struct_initialize_spec.rb +0 -46
- data/spec/ffi/struct_packed_spec.rb +0 -62
- data/spec/ffi/struct_spec.rb +0 -719
- data/spec/ffi/typedef_spec.rb +0 -89
- data/spec/ffi/union_spec.rb +0 -76
- data/spec/ffi/variadic_spec.rb +0 -103
- data/spec/spec.opts +0 -4
- data/tasks/ann.rake +0 -80
- data/tasks/extension.rake +0 -32
- data/tasks/gem.rake +0 -199
- data/tasks/git.rake +0 -41
- data/tasks/notes.rake +0 -27
- data/tasks/post_load.rake +0 -34
- data/tasks/rdoc.rake +0 -50
- data/tasks/rubyforge.rake +0 -55
- data/tasks/setup.rb +0 -301
- data/tasks/spec.rake +0 -54
- data/tasks/svn.rake +0 -47
- data/tasks/test.rake +0 -40
- data/tasks/yard.rake +0 -11
- data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
- data/lib/ffi/platform/{i486-gnu → i386-gnu}/types.conf +84 -84
@@ -1,6 +1,7 @@
|
|
1
1
|
/* -----------------------------------------------------------------------
|
2
|
-
unix64.S - Copyright (c)
|
3
|
-
|
2
|
+
unix64.S - Copyright (c) 2013 The Written Word, Inc.
|
3
|
+
- Copyright (c) 2008 Red Hat, Inc
|
4
|
+
- Copyright (c) 2002 Bo Thorsen <bo@suse.de>
|
4
5
|
|
5
6
|
x86-64 Foreign Function Interface
|
6
7
|
|
@@ -29,8 +30,23 @@
|
|
29
30
|
#define LIBFFI_ASM
|
30
31
|
#include <fficonfig.h>
|
31
32
|
#include <ffi.h>
|
32
|
-
|
33
|
-
.
|
33
|
+
#include "internal64.h"
|
34
|
+
#include "asmnames.h"
|
35
|
+
|
36
|
+
.text
|
37
|
+
|
38
|
+
/* This macro allows the safe creation of jump tables without an
|
39
|
+
actual table. The entry points into the table are all 8 bytes.
|
40
|
+
The use of ORG asserts that we're at the correct location. */
|
41
|
+
/* ??? The clang assembler doesn't handle .org with symbolic expressions. */
|
42
|
+
#ifdef __CET__
|
43
|
+
/* Double slot size to 16 byte to add 4 bytes of ENDBR64. */
|
44
|
+
# define E(BASE, X) .balign 8; .org BASE + X * 16
|
45
|
+
#elif defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
|
46
|
+
# define E(BASE, X) .balign 8
|
47
|
+
#else
|
48
|
+
# define E(BASE, X) .balign 8; .org BASE + X * 8
|
49
|
+
#endif
|
34
50
|
|
35
51
|
/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
|
36
52
|
void *raddr, void (*fnaddr)(void));
|
@@ -39,12 +55,13 @@
|
|
39
55
|
for this function. This has been allocated by ffi_call. We also
|
40
56
|
deallocate some of the stack that has been alloca'd. */
|
41
57
|
|
42
|
-
.
|
43
|
-
.globl ffi_call_unix64
|
44
|
-
|
58
|
+
.balign 8
|
59
|
+
.globl C(ffi_call_unix64)
|
60
|
+
FFI_HIDDEN(C(ffi_call_unix64))
|
45
61
|
|
46
|
-
ffi_call_unix64:
|
47
|
-
|
62
|
+
C(ffi_call_unix64):
|
63
|
+
L(UW0):
|
64
|
+
_CET_ENDBR
|
48
65
|
movq (%rsp), %r10 /* Load return address. */
|
49
66
|
leaq (%rdi, %rsi), %rax /* Find local stack base. */
|
50
67
|
movq %rdx, (%rax) /* Save flags. */
|
@@ -52,24 +69,36 @@ ffi_call_unix64:
|
|
52
69
|
movq %rbp, 16(%rax) /* Save old frame pointer. */
|
53
70
|
movq %r10, 24(%rax) /* Relocate return address. */
|
54
71
|
movq %rax, %rbp /* Finalize local stack frame. */
|
55
|
-
|
72
|
+
|
73
|
+
/* New stack frame based off rbp. This is a itty bit of unwind
|
74
|
+
trickery in that the CFA *has* changed. There is no easy way
|
75
|
+
to describe it correctly on entry to the function. Fortunately,
|
76
|
+
it doesn't matter too much since at all points we can correctly
|
77
|
+
unwind back to ffi_call. Note that the location to which we
|
78
|
+
moved the return address is (the new) CFA-8, so from the
|
79
|
+
perspective of the unwind info, it hasn't moved. */
|
80
|
+
L(UW1):
|
81
|
+
/* cfi_def_cfa(%rbp, 32) */
|
82
|
+
/* cfi_rel_offset(%rbp, 16) */
|
83
|
+
|
56
84
|
movq %rdi, %r10 /* Save a copy of the register area. */
|
57
85
|
movq %r8, %r11 /* Save a copy of the target fn. */
|
58
|
-
movl %r9d, %eax /* Set number of SSE registers. */
|
59
86
|
|
60
87
|
/* Load up all argument registers. */
|
61
88
|
movq (%r10), %rdi
|
62
|
-
movq
|
63
|
-
movq
|
64
|
-
movq
|
65
|
-
movq
|
66
|
-
movq
|
89
|
+
movq 0x08(%r10), %rsi
|
90
|
+
movq 0x10(%r10), %rdx
|
91
|
+
movq 0x18(%r10), %rcx
|
92
|
+
movq 0x20(%r10), %r8
|
93
|
+
movq 0x28(%r10), %r9
|
94
|
+
movl 0xb0(%r10), %eax /* Set number of SSE registers. */
|
67
95
|
testl %eax, %eax
|
68
|
-
jnz
|
69
|
-
|
96
|
+
jnz L(load_sse)
|
97
|
+
L(ret_from_load_sse):
|
70
98
|
|
71
|
-
/* Deallocate the reg arg area. */
|
72
|
-
leaq
|
99
|
+
/* Deallocate the reg arg area, except for r10, then load via pop. */
|
100
|
+
leaq 0xb8(%r10), %rsp
|
101
|
+
popq %r10
|
73
102
|
|
74
103
|
/* Call the user function. */
|
75
104
|
call *%r11
|
@@ -80,347 +109,603 @@ ffi_call_unix64:
|
|
80
109
|
movq 0(%rbp), %rcx /* Reload flags. */
|
81
110
|
movq 8(%rbp), %rdi /* Reload raddr. */
|
82
111
|
movq 16(%rbp), %rbp /* Reload old frame pointer. */
|
83
|
-
|
112
|
+
L(UW2):
|
113
|
+
/* cfi_remember_state */
|
114
|
+
/* cfi_def_cfa(%rsp, 8) */
|
115
|
+
/* cfi_restore(%rbp) */
|
84
116
|
|
85
117
|
/* The first byte of the flags contains the FFI_TYPE. */
|
118
|
+
cmpb $UNIX64_RET_LAST, %cl
|
86
119
|
movzbl %cl, %r10d
|
87
|
-
leaq
|
88
|
-
|
89
|
-
|
120
|
+
leaq L(store_table)(%rip), %r11
|
121
|
+
ja L(sa)
|
122
|
+
#ifdef __CET__
|
123
|
+
/* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 +
|
124
|
+
4 bytes NOP padding double slot size to 16 bytes. */
|
125
|
+
addl %r10d, %r10d
|
126
|
+
#endif
|
127
|
+
leaq (%r11, %r10, 8), %r10
|
128
|
+
|
129
|
+
/* Prep for the structure cases: scratch area in redzone. */
|
130
|
+
leaq -20(%rsp), %rsi
|
90
131
|
jmp *%r10
|
91
132
|
|
92
|
-
.
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
.long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
|
97
|
-
.long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
|
98
|
-
.long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
|
99
|
-
.long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
|
100
|
-
.long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
|
101
|
-
.long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
|
102
|
-
.long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
|
103
|
-
.long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
|
104
|
-
.long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
|
105
|
-
.long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
|
106
|
-
.long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
|
107
|
-
.long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
|
108
|
-
|
109
|
-
.align 2
|
110
|
-
.Lst_void:
|
133
|
+
.balign 8
|
134
|
+
L(store_table):
|
135
|
+
E(L(store_table), UNIX64_RET_VOID)
|
136
|
+
_CET_ENDBR
|
111
137
|
ret
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
movzbq %al, %rax
|
138
|
+
E(L(store_table), UNIX64_RET_UINT8)
|
139
|
+
_CET_ENDBR
|
140
|
+
movzbl %al, %eax
|
116
141
|
movq %rax, (%rdi)
|
117
142
|
ret
|
118
|
-
|
119
|
-
|
120
|
-
|
143
|
+
E(L(store_table), UNIX64_RET_UINT16)
|
144
|
+
_CET_ENDBR
|
145
|
+
movzwl %ax, %eax
|
121
146
|
movq %rax, (%rdi)
|
122
147
|
ret
|
123
|
-
|
124
|
-
|
125
|
-
|
148
|
+
E(L(store_table), UNIX64_RET_UINT32)
|
149
|
+
_CET_ENDBR
|
150
|
+
movl %eax, %eax
|
126
151
|
movq %rax, (%rdi)
|
127
|
-
|
128
|
-
|
129
|
-
|
152
|
+
ret
|
153
|
+
E(L(store_table), UNIX64_RET_SINT8)
|
154
|
+
_CET_ENDBR
|
155
|
+
movsbq %al, %rax
|
130
156
|
movq %rax, (%rdi)
|
131
157
|
ret
|
132
|
-
|
133
|
-
|
134
|
-
|
158
|
+
E(L(store_table), UNIX64_RET_SINT16)
|
159
|
+
_CET_ENDBR
|
160
|
+
movswq %ax, %rax
|
135
161
|
movq %rax, (%rdi)
|
136
|
-
|
137
|
-
|
162
|
+
ret
|
163
|
+
E(L(store_table), UNIX64_RET_SINT32)
|
164
|
+
_CET_ENDBR
|
138
165
|
cltq
|
139
166
|
movq %rax, (%rdi)
|
140
167
|
ret
|
141
|
-
|
142
|
-
|
168
|
+
E(L(store_table), UNIX64_RET_INT64)
|
169
|
+
_CET_ENDBR
|
143
170
|
movq %rax, (%rdi)
|
144
171
|
ret
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
movss %xmm0, (%rdi)
|
172
|
+
E(L(store_table), UNIX64_RET_XMM32)
|
173
|
+
_CET_ENDBR
|
174
|
+
movd %xmm0, (%rdi)
|
149
175
|
ret
|
150
|
-
|
151
|
-
|
152
|
-
|
176
|
+
E(L(store_table), UNIX64_RET_XMM64)
|
177
|
+
_CET_ENDBR
|
178
|
+
movq %xmm0, (%rdi)
|
153
179
|
ret
|
154
|
-
|
180
|
+
E(L(store_table), UNIX64_RET_X87)
|
181
|
+
_CET_ENDBR
|
155
182
|
fstpt (%rdi)
|
156
183
|
ret
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
cmovnz %r11, %rdx
|
177
|
-
movq %rax, (%rsi)
|
184
|
+
E(L(store_table), UNIX64_RET_X87_2)
|
185
|
+
_CET_ENDBR
|
186
|
+
fstpt (%rdi)
|
187
|
+
fstpt 16(%rdi)
|
188
|
+
ret
|
189
|
+
E(L(store_table), UNIX64_RET_ST_XMM0_RAX)
|
190
|
+
_CET_ENDBR
|
191
|
+
movq %rax, 8(%rsi)
|
192
|
+
jmp L(s3)
|
193
|
+
E(L(store_table), UNIX64_RET_ST_RAX_XMM0)
|
194
|
+
_CET_ENDBR
|
195
|
+
movq %xmm0, 8(%rsi)
|
196
|
+
jmp L(s2)
|
197
|
+
E(L(store_table), UNIX64_RET_ST_XMM0_XMM1)
|
198
|
+
_CET_ENDBR
|
199
|
+
movq %xmm1, 8(%rsi)
|
200
|
+
jmp L(s3)
|
201
|
+
E(L(store_table), UNIX64_RET_ST_RAX_RDX)
|
202
|
+
_CET_ENDBR
|
178
203
|
movq %rdx, 8(%rsi)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
204
|
+
L(s2):
|
205
|
+
movq %rax, (%rsi)
|
206
|
+
shrl $UNIX64_SIZE_SHIFT, %ecx
|
207
|
+
rep movsb
|
208
|
+
ret
|
209
|
+
.balign 8
|
210
|
+
L(s3):
|
211
|
+
movq %xmm0, (%rsi)
|
212
|
+
shrl $UNIX64_SIZE_SHIFT, %ecx
|
183
213
|
rep movsb
|
184
214
|
ret
|
185
215
|
|
216
|
+
L(sa): call PLT(C(abort))
|
217
|
+
|
186
218
|
/* Many times we can avoid loading any SSE registers at all.
|
187
219
|
It's not worth an indirect jump to load the exact set of
|
188
220
|
SSE registers needed; zero or all is a good compromise. */
|
189
|
-
.
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
movdqa
|
194
|
-
movdqa
|
195
|
-
movdqa
|
196
|
-
movdqa
|
197
|
-
movdqa
|
198
|
-
movdqa
|
199
|
-
movdqa
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
221
|
+
.balign 2
|
222
|
+
L(UW3):
|
223
|
+
/* cfi_restore_state */
|
224
|
+
L(load_sse):
|
225
|
+
movdqa 0x30(%r10), %xmm0
|
226
|
+
movdqa 0x40(%r10), %xmm1
|
227
|
+
movdqa 0x50(%r10), %xmm2
|
228
|
+
movdqa 0x60(%r10), %xmm3
|
229
|
+
movdqa 0x70(%r10), %xmm4
|
230
|
+
movdqa 0x80(%r10), %xmm5
|
231
|
+
movdqa 0x90(%r10), %xmm6
|
232
|
+
movdqa 0xa0(%r10), %xmm7
|
233
|
+
jmp L(ret_from_load_sse)
|
234
|
+
|
235
|
+
L(UW4):
|
236
|
+
ENDF(C(ffi_call_unix64))
|
237
|
+
|
238
|
+
/* 6 general registers, 8 vector registers,
|
239
|
+
32 bytes of rvalue, 8 bytes of alignment. */
|
240
|
+
#define ffi_closure_OFS_G 0
|
241
|
+
#define ffi_closure_OFS_V (6*8)
|
242
|
+
#define ffi_closure_OFS_RVALUE (ffi_closure_OFS_V + 8*16)
|
243
|
+
#define ffi_closure_FS (ffi_closure_OFS_RVALUE + 32 + 8)
|
244
|
+
|
245
|
+
/* The location of rvalue within the red zone after deallocating the frame. */
|
246
|
+
#define ffi_closure_RED_RVALUE (ffi_closure_OFS_RVALUE - ffi_closure_FS)
|
247
|
+
|
248
|
+
.balign 2
|
249
|
+
.globl C(ffi_closure_unix64_sse)
|
250
|
+
FFI_HIDDEN(C(ffi_closure_unix64_sse))
|
251
|
+
|
252
|
+
C(ffi_closure_unix64_sse):
|
253
|
+
L(UW5):
|
254
|
+
_CET_ENDBR
|
255
|
+
subq $ffi_closure_FS, %rsp
|
256
|
+
L(UW6):
|
257
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
258
|
+
|
259
|
+
movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp)
|
260
|
+
movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp)
|
261
|
+
movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp)
|
262
|
+
movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp)
|
263
|
+
movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp)
|
264
|
+
movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp)
|
265
|
+
movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp)
|
266
|
+
movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp)
|
267
|
+
jmp L(sse_entry1)
|
268
|
+
|
269
|
+
L(UW7):
|
270
|
+
ENDF(C(ffi_closure_unix64_sse))
|
271
|
+
|
272
|
+
.balign 2
|
273
|
+
.globl C(ffi_closure_unix64)
|
274
|
+
FFI_HIDDEN(C(ffi_closure_unix64))
|
275
|
+
|
276
|
+
C(ffi_closure_unix64):
|
277
|
+
L(UW8):
|
278
|
+
_CET_ENDBR
|
279
|
+
subq $ffi_closure_FS, %rsp
|
280
|
+
L(UW9):
|
281
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
282
|
+
L(sse_entry1):
|
283
|
+
movq %rdi, ffi_closure_OFS_G+0x00(%rsp)
|
284
|
+
movq %rsi, ffi_closure_OFS_G+0x08(%rsp)
|
285
|
+
movq %rdx, ffi_closure_OFS_G+0x10(%rsp)
|
286
|
+
movq %rcx, ffi_closure_OFS_G+0x18(%rsp)
|
287
|
+
movq %r8, ffi_closure_OFS_G+0x20(%rsp)
|
288
|
+
movq %r9, ffi_closure_OFS_G+0x28(%rsp)
|
289
|
+
|
290
|
+
#ifdef __ILP32__
|
291
|
+
movl FFI_TRAMPOLINE_SIZE(%r10), %edi /* Load cif */
|
292
|
+
movl FFI_TRAMPOLINE_SIZE+4(%r10), %esi /* Load fun */
|
293
|
+
movl FFI_TRAMPOLINE_SIZE+8(%r10), %edx /* Load user_data */
|
294
|
+
#else
|
295
|
+
movq FFI_TRAMPOLINE_SIZE(%r10), %rdi /* Load cif */
|
296
|
+
movq FFI_TRAMPOLINE_SIZE+8(%r10), %rsi /* Load fun */
|
297
|
+
movq FFI_TRAMPOLINE_SIZE+16(%r10), %rdx /* Load user_data */
|
298
|
+
#endif
|
299
|
+
L(do_closure):
|
300
|
+
leaq ffi_closure_OFS_RVALUE(%rsp), %rcx /* Load rvalue */
|
301
|
+
movq %rsp, %r8 /* Load reg_args */
|
302
|
+
leaq ffi_closure_FS+8(%rsp), %r9 /* Load argp */
|
303
|
+
call PLT(C(ffi_closure_unix64_inner))
|
229
304
|
|
230
305
|
/* Deallocate stack frame early; return value is now in redzone. */
|
231
|
-
addq $
|
232
|
-
|
306
|
+
addq $ffi_closure_FS, %rsp
|
307
|
+
L(UW10):
|
308
|
+
/* cfi_adjust_cfa_offset(-ffi_closure_FS) */
|
233
309
|
|
234
310
|
/* The first byte of the return value contains the FFI_TYPE. */
|
311
|
+
cmpb $UNIX64_RET_LAST, %al
|
235
312
|
movzbl %al, %r10d
|
236
|
-
leaq
|
237
|
-
|
238
|
-
|
313
|
+
leaq L(load_table)(%rip), %r11
|
314
|
+
ja L(la)
|
315
|
+
#ifdef __CET__
|
316
|
+
/* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 +
|
317
|
+
4 bytes NOP padding double slot size to 16 bytes. */
|
318
|
+
addl %r10d, %r10d
|
319
|
+
#endif
|
320
|
+
leaq (%r11, %r10, 8), %r10
|
321
|
+
leaq ffi_closure_RED_RVALUE(%rsp), %rsi
|
239
322
|
jmp *%r10
|
240
323
|
|
241
|
-
.
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
.long .Lld_double-.Lload_table /* FFI_TYPE_DOUBLE */
|
246
|
-
.long .Lld_ldouble-.Lload_table /* FFI_TYPE_LONGDOUBLE */
|
247
|
-
.long .Lld_int8-.Lload_table /* FFI_TYPE_UINT8 */
|
248
|
-
.long .Lld_int8-.Lload_table /* FFI_TYPE_SINT8 */
|
249
|
-
.long .Lld_int16-.Lload_table /* FFI_TYPE_UINT16 */
|
250
|
-
.long .Lld_int16-.Lload_table /* FFI_TYPE_SINT16 */
|
251
|
-
.long .Lld_int32-.Lload_table /* FFI_TYPE_UINT32 */
|
252
|
-
.long .Lld_int32-.Lload_table /* FFI_TYPE_SINT32 */
|
253
|
-
.long .Lld_int64-.Lload_table /* FFI_TYPE_UINT64 */
|
254
|
-
.long .Lld_int64-.Lload_table /* FFI_TYPE_SINT64 */
|
255
|
-
.long .Lld_struct-.Lload_table /* FFI_TYPE_STRUCT */
|
256
|
-
.long .Lld_int64-.Lload_table /* FFI_TYPE_POINTER */
|
257
|
-
|
258
|
-
.align 2
|
259
|
-
.Lld_void:
|
324
|
+
.balign 8
|
325
|
+
L(load_table):
|
326
|
+
E(L(load_table), UNIX64_RET_VOID)
|
327
|
+
_CET_ENDBR
|
260
328
|
ret
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
movzbl -24(%rsp), %eax
|
329
|
+
E(L(load_table), UNIX64_RET_UINT8)
|
330
|
+
_CET_ENDBR
|
331
|
+
movzbl (%rsi), %eax
|
265
332
|
ret
|
266
|
-
|
267
|
-
|
268
|
-
movzwl
|
333
|
+
E(L(load_table), UNIX64_RET_UINT16)
|
334
|
+
_CET_ENDBR
|
335
|
+
movzwl (%rsi), %eax
|
269
336
|
ret
|
270
|
-
|
271
|
-
|
272
|
-
movl
|
337
|
+
E(L(load_table), UNIX64_RET_UINT32)
|
338
|
+
_CET_ENDBR
|
339
|
+
movl (%rsi), %eax
|
273
340
|
ret
|
274
|
-
|
275
|
-
|
276
|
-
|
341
|
+
E(L(load_table), UNIX64_RET_SINT8)
|
342
|
+
_CET_ENDBR
|
343
|
+
movsbl (%rsi), %eax
|
277
344
|
ret
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
movss -24(%rsp), %xmm0
|
345
|
+
E(L(load_table), UNIX64_RET_SINT16)
|
346
|
+
_CET_ENDBR
|
347
|
+
movswl (%rsi), %eax
|
282
348
|
ret
|
283
|
-
|
284
|
-
|
285
|
-
|
349
|
+
E(L(load_table), UNIX64_RET_SINT32)
|
350
|
+
_CET_ENDBR
|
351
|
+
movl (%rsi), %eax
|
286
352
|
ret
|
287
|
-
|
288
|
-
|
289
|
-
|
353
|
+
E(L(load_table), UNIX64_RET_INT64)
|
354
|
+
_CET_ENDBR
|
355
|
+
movq (%rsi), %rax
|
290
356
|
ret
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
357
|
+
E(L(load_table), UNIX64_RET_XMM32)
|
358
|
+
_CET_ENDBR
|
359
|
+
movd (%rsi), %xmm0
|
360
|
+
ret
|
361
|
+
E(L(load_table), UNIX64_RET_XMM64)
|
362
|
+
_CET_ENDBR
|
363
|
+
movq (%rsi), %xmm0
|
364
|
+
ret
|
365
|
+
E(L(load_table), UNIX64_RET_X87)
|
366
|
+
_CET_ENDBR
|
367
|
+
fldt (%rsi)
|
368
|
+
ret
|
369
|
+
E(L(load_table), UNIX64_RET_X87_2)
|
370
|
+
_CET_ENDBR
|
371
|
+
fldt 16(%rsi)
|
372
|
+
fldt (%rsi)
|
373
|
+
ret
|
374
|
+
E(L(load_table), UNIX64_RET_ST_XMM0_RAX)
|
375
|
+
_CET_ENDBR
|
376
|
+
movq 8(%rsi), %rax
|
377
|
+
jmp L(l3)
|
378
|
+
E(L(load_table), UNIX64_RET_ST_RAX_XMM0)
|
379
|
+
_CET_ENDBR
|
380
|
+
movq 8(%rsi), %xmm0
|
381
|
+
jmp L(l2)
|
382
|
+
E(L(load_table), UNIX64_RET_ST_XMM0_XMM1)
|
383
|
+
_CET_ENDBR
|
384
|
+
movq 8(%rsi), %xmm1
|
385
|
+
jmp L(l3)
|
386
|
+
E(L(load_table), UNIX64_RET_ST_RAX_RDX)
|
387
|
+
_CET_ENDBR
|
388
|
+
movq 8(%rsi), %rdx
|
389
|
+
L(l2):
|
390
|
+
movq (%rsi), %rax
|
391
|
+
ret
|
392
|
+
.balign 8
|
393
|
+
L(l3):
|
394
|
+
movq (%rsi), %xmm0
|
308
395
|
ret
|
309
396
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
397
|
+
L(la): call PLT(C(abort))
|
398
|
+
|
399
|
+
L(UW11):
|
400
|
+
ENDF(C(ffi_closure_unix64))
|
401
|
+
|
402
|
+
.balign 2
|
403
|
+
.globl C(ffi_go_closure_unix64_sse)
|
404
|
+
FFI_HIDDEN(C(ffi_go_closure_unix64_sse))
|
405
|
+
|
406
|
+
C(ffi_go_closure_unix64_sse):
|
407
|
+
L(UW12):
|
408
|
+
_CET_ENDBR
|
409
|
+
subq $ffi_closure_FS, %rsp
|
410
|
+
L(UW13):
|
411
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
412
|
+
|
413
|
+
movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp)
|
414
|
+
movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp)
|
415
|
+
movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp)
|
416
|
+
movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp)
|
417
|
+
movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp)
|
418
|
+
movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp)
|
419
|
+
movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp)
|
420
|
+
movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp)
|
421
|
+
jmp L(sse_entry2)
|
422
|
+
|
423
|
+
L(UW14):
|
424
|
+
ENDF(C(ffi_go_closure_unix64_sse))
|
425
|
+
|
426
|
+
.balign 2
|
427
|
+
.globl C(ffi_go_closure_unix64)
|
428
|
+
FFI_HIDDEN(C(ffi_go_closure_unix64))
|
429
|
+
|
430
|
+
C(ffi_go_closure_unix64):
|
431
|
+
L(UW15):
|
432
|
+
_CET_ENDBR
|
433
|
+
subq $ffi_closure_FS, %rsp
|
434
|
+
L(UW16):
|
435
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
436
|
+
L(sse_entry2):
|
437
|
+
movq %rdi, ffi_closure_OFS_G+0x00(%rsp)
|
438
|
+
movq %rsi, ffi_closure_OFS_G+0x08(%rsp)
|
439
|
+
movq %rdx, ffi_closure_OFS_G+0x10(%rsp)
|
440
|
+
movq %rcx, ffi_closure_OFS_G+0x18(%rsp)
|
441
|
+
movq %r8, ffi_closure_OFS_G+0x20(%rsp)
|
442
|
+
movq %r9, ffi_closure_OFS_G+0x28(%rsp)
|
443
|
+
|
444
|
+
#ifdef __ILP32__
|
445
|
+
movl 4(%r10), %edi /* Load cif */
|
446
|
+
movl 8(%r10), %esi /* Load fun */
|
447
|
+
movl %r10d, %edx /* Load closure (user_data) */
|
329
448
|
#else
|
330
|
-
|
449
|
+
movq 8(%r10), %rdi /* Load cif */
|
450
|
+
movq 16(%r10), %rsi /* Load fun */
|
451
|
+
movq %r10, %rdx /* Load closure (user_data) */
|
331
452
|
#endif
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
.
|
339
|
-
.
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
.
|
351
|
-
.
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
453
|
+
jmp L(do_closure)
|
454
|
+
|
455
|
+
L(UW17):
|
456
|
+
ENDF(C(ffi_go_closure_unix64))
|
457
|
+
|
458
|
+
#if defined(FFI_EXEC_STATIC_TRAMP)
|
459
|
+
.balign 8
|
460
|
+
.globl C(ffi_closure_unix64_sse_alt)
|
461
|
+
FFI_HIDDEN(C(ffi_closure_unix64_sse_alt))
|
462
|
+
|
463
|
+
C(ffi_closure_unix64_sse_alt):
|
464
|
+
/* See the comments above trampoline_code_table. */
|
465
|
+
_CET_ENDBR
|
466
|
+
movq 8(%rsp), %r10 /* Load closure in r10 */
|
467
|
+
addq $16, %rsp /* Restore the stack */
|
468
|
+
jmp C(ffi_closure_unix64_sse)
|
469
|
+
ENDF(C(ffi_closure_unix64_sse_alt))
|
470
|
+
|
471
|
+
.balign 8
|
472
|
+
.globl C(ffi_closure_unix64_alt)
|
473
|
+
FFI_HIDDEN(C(ffi_closure_unix64_alt))
|
474
|
+
|
475
|
+
C(ffi_closure_unix64_alt):
|
476
|
+
/* See the comments above trampoline_code_table. */
|
477
|
+
_CET_ENDBR
|
478
|
+
movq 8(%rsp), %r10 /* Load closure in r10 */
|
479
|
+
addq $16, %rsp /* Restore the stack */
|
480
|
+
jmp C(ffi_closure_unix64)
|
481
|
+
ENDF(C(ffi_closure_unix64_alt))
|
482
|
+
|
483
|
+
/*
|
484
|
+
* Below is the definition of the trampoline code table. Each element in
|
485
|
+
* the code table is a trampoline.
|
486
|
+
*
|
487
|
+
* Because we jump to the trampoline, we place a _CET_ENDBR at the
|
488
|
+
* beginning of the trampoline to mark it as a valid branch target. This is
|
489
|
+
* part of the the Intel CET (Control Flow Enforcement Technology).
|
490
|
+
*/
|
491
|
+
/*
|
492
|
+
* The trampoline uses register r10. It saves the original value of r10 on
|
493
|
+
* the stack.
|
494
|
+
*
|
495
|
+
* The trampoline has two parameters - target code to jump to and data for
|
496
|
+
* the target code. The trampoline extracts the parameters from its parameter
|
497
|
+
* block (see tramp_table_map()). The trampoline saves the data address on
|
498
|
+
* the stack. Finally, it jumps to the target code.
|
499
|
+
*
|
500
|
+
* The target code can choose to:
|
501
|
+
*
|
502
|
+
* - restore the value of r10
|
503
|
+
* - load the data address in a register
|
504
|
+
* - restore the stack pointer to what it was when the trampoline was invoked.
|
505
|
+
*/
|
506
|
+
#ifdef ENDBR_PRESENT
|
507
|
+
# define X86_DATA_OFFSET 4077
|
508
|
+
# ifdef __ILP32__
|
509
|
+
# define X86_CODE_OFFSET 4069
|
510
|
+
# else
|
511
|
+
# define X86_CODE_OFFSET 4073
|
512
|
+
# endif
|
356
513
|
#else
|
357
|
-
|
514
|
+
# define X86_DATA_OFFSET 4081
|
515
|
+
# ifdef __ILP32__
|
516
|
+
# define X86_CODE_OFFSET 4073
|
517
|
+
# else
|
518
|
+
# define X86_CODE_OFFSET 4077
|
519
|
+
# endif
|
358
520
|
#endif
|
359
|
-
.long .LUW4-.LUW0 /* FDE address range */
|
360
|
-
.uleb128 0x0 /* Augmentation size */
|
361
521
|
|
362
|
-
.
|
363
|
-
.
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
.
|
384
|
-
.
|
522
|
+
.align UNIX64_TRAMP_MAP_SIZE
|
523
|
+
.globl trampoline_code_table
|
524
|
+
FFI_HIDDEN(C(trampoline_code_table))
|
525
|
+
|
526
|
+
C(trampoline_code_table):
|
527
|
+
.rept UNIX64_TRAMP_MAP_SIZE / UNIX64_TRAMP_SIZE
|
528
|
+
_CET_ENDBR
|
529
|
+
subq $16, %rsp /* Make space on the stack */
|
530
|
+
movq %r10, (%rsp) /* Save %r10 on stack */
|
531
|
+
#ifdef __ILP32__
|
532
|
+
movl X86_DATA_OFFSET(%rip), %r10d /* Copy data into %r10 */
|
533
|
+
#else
|
534
|
+
movq X86_DATA_OFFSET(%rip), %r10 /* Copy data into %r10 */
|
535
|
+
#endif
|
536
|
+
movq %r10, 8(%rsp) /* Save data on stack */
|
537
|
+
#ifdef __ILP32__
|
538
|
+
movl X86_CODE_OFFSET(%rip), %r10d /* Copy code into %r10 */
|
539
|
+
#else
|
540
|
+
movq X86_CODE_OFFSET(%rip), %r10 /* Copy code into %r10 */
|
541
|
+
#endif
|
542
|
+
jmp *%r10 /* Jump to code */
|
543
|
+
.align 8
|
544
|
+
.endr
|
545
|
+
ENDF(C(trampoline_code_table))
|
546
|
+
.align UNIX64_TRAMP_MAP_SIZE
|
547
|
+
#endif /* FFI_EXEC_STATIC_TRAMP */
|
548
|
+
|
549
|
+
/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */
|
550
|
+
|
551
|
+
#ifdef __APPLE__
|
552
|
+
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
|
553
|
+
EHFrame0:
|
554
|
+
#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
|
555
|
+
.section .eh_frame,"a",@unwind
|
556
|
+
#else
|
557
|
+
.section .eh_frame,"a",@progbits
|
558
|
+
#endif
|
385
559
|
|
386
|
-
|
387
|
-
.
|
388
|
-
|
560
|
+
#ifdef HAVE_AS_X86_PCREL
|
561
|
+
# define PCREL(X) X - .
|
562
|
+
#else
|
563
|
+
# define PCREL(X) X@rel
|
564
|
+
#endif
|
389
565
|
|
390
|
-
|
391
|
-
|
392
|
-
.
|
393
|
-
.
|
394
|
-
.LASFDE3:
|
395
|
-
.long .LASFDE3-.Lframe1 /* FDE CIE offset */
|
396
|
-
#if HAVE_AS_X86_PCREL
|
397
|
-
.long .LUW5-. /* FDE initial location */
|
566
|
+
/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */
|
567
|
+
#ifdef __CET__
|
568
|
+
/* Use DW_CFA_advance_loc2 when IBT is enabled. */
|
569
|
+
# define ADV(N, P) .byte 3; .2byte L(N)-L(P)
|
398
570
|
#else
|
399
|
-
.
|
571
|
+
# define ADV(N, P) .byte 2, L(N)-L(P)
|
400
572
|
#endif
|
401
|
-
.long .LUW9-.LUW5 /* FDE address range */
|
402
|
-
.uleb128 0x0 /* Augmentation size */
|
403
573
|
|
404
|
-
.
|
405
|
-
|
406
|
-
.
|
407
|
-
.
|
574
|
+
.balign 8
|
575
|
+
L(CIE):
|
576
|
+
.set L(set0),L(ECIE)-L(SCIE)
|
577
|
+
.long L(set0) /* CIE Length */
|
578
|
+
L(SCIE):
|
579
|
+
.long 0 /* CIE Identifier Tag */
|
580
|
+
.byte 1 /* CIE Version */
|
581
|
+
.ascii "zR\0" /* CIE Augmentation */
|
582
|
+
.byte 1 /* CIE Code Alignment Factor */
|
583
|
+
.byte 0x78 /* CIE Data Alignment Factor */
|
584
|
+
.byte 0x10 /* CIE RA Column */
|
585
|
+
.byte 1 /* Augmentation size */
|
586
|
+
.byte 0x1b /* FDE Encoding (pcrel sdata4) */
|
587
|
+
.byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp offset 8 */
|
588
|
+
.byte 0x80+16, 1 /* DW_CFA_offset, %rip offset 1*-8 */
|
589
|
+
.balign 8
|
590
|
+
L(ECIE):
|
591
|
+
|
592
|
+
.set L(set1),L(EFDE1)-L(SFDE1)
|
593
|
+
.long L(set1) /* FDE Length */
|
594
|
+
L(SFDE1):
|
595
|
+
.long L(SFDE1)-L(CIE) /* FDE CIE offset */
|
596
|
+
.long PCREL(L(UW0)) /* Initial location */
|
597
|
+
.long L(UW4)-L(UW0) /* Address range */
|
598
|
+
.byte 0 /* Augmentation size */
|
599
|
+
ADV(UW1, UW0)
|
600
|
+
.byte 0xc, 6, 32 /* DW_CFA_def_cfa, %rbp 32 */
|
601
|
+
.byte 0x80+6, 2 /* DW_CFA_offset, %rbp 2*-8 */
|
602
|
+
ADV(UW2, UW1)
|
408
603
|
.byte 0xa /* DW_CFA_remember_state */
|
409
|
-
|
410
|
-
.byte
|
411
|
-
|
412
|
-
.byte 0xe /* DW_CFA_def_cfa_offset */
|
413
|
-
.uleb128 8
|
414
|
-
|
415
|
-
.byte 0x4 /* DW_CFA_advance_loc4 */
|
416
|
-
.long .LUW8-.LUW7
|
604
|
+
.byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp 8 */
|
605
|
+
.byte 0xc0+6 /* DW_CFA_restore, %rbp */
|
606
|
+
ADV(UW3, UW2)
|
417
607
|
.byte 0xb /* DW_CFA_restore_state */
|
418
|
-
|
419
|
-
|
420
|
-
|
608
|
+
.balign 8
|
609
|
+
L(EFDE1):
|
610
|
+
|
611
|
+
.set L(set2),L(EFDE2)-L(SFDE2)
|
612
|
+
.long L(set2) /* FDE Length */
|
613
|
+
L(SFDE2):
|
614
|
+
.long L(SFDE2)-L(CIE) /* FDE CIE offset */
|
615
|
+
.long PCREL(L(UW5)) /* Initial location */
|
616
|
+
.long L(UW7)-L(UW5) /* Address range */
|
617
|
+
.byte 0 /* Augmentation size */
|
618
|
+
ADV(UW6, UW5)
|
619
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
620
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
621
|
+
.balign 8
|
622
|
+
L(EFDE2):
|
623
|
+
|
624
|
+
.set L(set3),L(EFDE3)-L(SFDE3)
|
625
|
+
.long L(set3) /* FDE Length */
|
626
|
+
L(SFDE3):
|
627
|
+
.long L(SFDE3)-L(CIE) /* FDE CIE offset */
|
628
|
+
.long PCREL(L(UW8)) /* Initial location */
|
629
|
+
.long L(UW11)-L(UW8) /* Address range */
|
630
|
+
.byte 0 /* Augmentation size */
|
631
|
+
ADV(UW9, UW8)
|
632
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
633
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
634
|
+
ADV(UW10, UW9)
|
635
|
+
.byte 0xe, 8 /* DW_CFA_def_cfa_offset 8 */
|
636
|
+
L(EFDE3):
|
637
|
+
|
638
|
+
.set L(set4),L(EFDE4)-L(SFDE4)
|
639
|
+
.long L(set4) /* FDE Length */
|
640
|
+
L(SFDE4):
|
641
|
+
.long L(SFDE4)-L(CIE) /* FDE CIE offset */
|
642
|
+
.long PCREL(L(UW12)) /* Initial location */
|
643
|
+
.long L(UW14)-L(UW12) /* Address range */
|
644
|
+
.byte 0 /* Augmentation size */
|
645
|
+
ADV(UW13, UW12)
|
646
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
647
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
648
|
+
.balign 8
|
649
|
+
L(EFDE4):
|
650
|
+
|
651
|
+
.set L(set5),L(EFDE5)-L(SFDE5)
|
652
|
+
.long L(set5) /* FDE Length */
|
653
|
+
L(SFDE5):
|
654
|
+
.long L(SFDE5)-L(CIE) /* FDE CIE offset */
|
655
|
+
.long PCREL(L(UW15)) /* Initial location */
|
656
|
+
.long L(UW17)-L(UW15) /* Address range */
|
657
|
+
.byte 0 /* Augmentation size */
|
658
|
+
ADV(UW16, UW15)
|
659
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
660
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
661
|
+
.balign 8
|
662
|
+
L(EFDE5):
|
663
|
+
#ifdef __APPLE__
|
664
|
+
.subsections_via_symbols
|
665
|
+
.section __LD,__compact_unwind,regular,debug
|
666
|
+
|
667
|
+
/* compact unwind for ffi_call_unix64 */
|
668
|
+
.quad C(ffi_call_unix64)
|
669
|
+
.set L1,L(UW4)-L(UW0)
|
670
|
+
.long L1
|
671
|
+
.long 0x04000000 /* use dwarf unwind info */
|
672
|
+
.quad 0
|
673
|
+
.quad 0
|
674
|
+
|
675
|
+
/* compact unwind for ffi_closure_unix64_sse */
|
676
|
+
.quad C(ffi_closure_unix64_sse)
|
677
|
+
.set L2,L(UW7)-L(UW5)
|
678
|
+
.long L2
|
679
|
+
.long 0x04000000 /* use dwarf unwind info */
|
680
|
+
.quad 0
|
681
|
+
.quad 0
|
682
|
+
|
683
|
+
/* compact unwind for ffi_closure_unix64 */
|
684
|
+
.quad C(ffi_closure_unix64)
|
685
|
+
.set L3,L(UW11)-L(UW8)
|
686
|
+
.long L3
|
687
|
+
.long 0x04000000 /* use dwarf unwind info */
|
688
|
+
.quad 0
|
689
|
+
.quad 0
|
690
|
+
|
691
|
+
/* compact unwind for ffi_go_closure_unix64_sse */
|
692
|
+
.quad C(ffi_go_closure_unix64_sse)
|
693
|
+
.set L4,L(UW14)-L(UW12)
|
694
|
+
.long L4
|
695
|
+
.long 0x04000000 /* use dwarf unwind info */
|
696
|
+
.quad 0
|
697
|
+
.quad 0
|
698
|
+
|
699
|
+
/* compact unwind for ffi_go_closure_unix64 */
|
700
|
+
.quad C(ffi_go_closure_unix64)
|
701
|
+
.set L5,L(UW17)-L(UW15)
|
702
|
+
.long L5
|
703
|
+
.long 0x04000000 /* use dwarf unwind info */
|
704
|
+
.quad 0
|
705
|
+
.quad 0
|
706
|
+
#endif
|
421
707
|
|
422
708
|
#endif /* __x86_64__ */
|
423
|
-
|
424
709
|
#if defined __ELF__ && defined __linux__
|
425
710
|
.section .note.GNU-stack,"",@progbits
|
426
711
|
#endif
|