ffi 1.1.5 → 1.15.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (629) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +338 -0
  3. data/COPYING +49 -0
  4. data/Gemfile +14 -0
  5. data/LICENSE +21 -11
  6. data/LICENSE.SPECS +22 -0
  7. data/README.md +136 -0
  8. data/Rakefile +149 -154
  9. data/ext/ffi_c/AbstractMemory.c +133 -57
  10. data/ext/ffi_c/AbstractMemory.h +21 -12
  11. data/ext/ffi_c/ArrayType.c +27 -14
  12. data/ext/ffi_c/ArrayType.h +21 -12
  13. data/ext/ffi_c/Buffer.c +29 -25
  14. data/ext/ffi_c/Call.c +154 -125
  15. data/ext/ffi_c/Call.h +43 -20
  16. data/ext/ffi_c/ClosurePool.c +100 -42
  17. data/ext/ffi_c/ClosurePool.h +24 -13
  18. data/ext/ffi_c/DynamicLibrary.c +47 -28
  19. data/ext/ffi_c/DynamicLibrary.h +70 -12
  20. data/ext/ffi_c/Function.c +119 -167
  21. data/ext/ffi_c/Function.h +23 -19
  22. data/ext/ffi_c/FunctionInfo.c +55 -25
  23. data/ext/ffi_c/LastError.c +70 -21
  24. data/ext/ffi_c/LastError.h +21 -12
  25. data/ext/ffi_c/LongDouble.c +15 -9
  26. data/ext/ffi_c/LongDouble.h +21 -16
  27. data/ext/ffi_c/MappedType.c +22 -15
  28. data/ext/ffi_c/MappedType.h +21 -12
  29. data/ext/ffi_c/MemoryPointer.c +58 -33
  30. data/ext/ffi_c/MemoryPointer.h +22 -19
  31. data/ext/ffi_c/MethodHandle.c +49 -50
  32. data/ext/ffi_c/MethodHandle.h +24 -14
  33. data/ext/ffi_c/Platform.c +28 -62
  34. data/ext/ffi_c/Platform.h +21 -12
  35. data/ext/ffi_c/Pointer.c +63 -46
  36. data/ext/ffi_c/Pointer.h +22 -19
  37. data/ext/ffi_c/Struct.c +198 -80
  38. data/ext/ffi_c/Struct.h +33 -18
  39. data/ext/ffi_c/StructByValue.c +23 -20
  40. data/ext/ffi_c/StructByValue.h +21 -12
  41. data/ext/ffi_c/StructLayout.c +184 -39
  42. data/ext/ffi_c/Thread.c +73 -270
  43. data/ext/ffi_c/Thread.h +32 -35
  44. data/ext/ffi_c/Type.c +26 -32
  45. data/ext/ffi_c/Type.h +24 -10
  46. data/ext/ffi_c/Types.c +28 -20
  47. data/ext/ffi_c/Types.h +25 -16
  48. data/ext/ffi_c/Variadic.c +78 -39
  49. data/ext/ffi_c/compat.h +25 -17
  50. data/ext/ffi_c/extconf.rb +68 -31
  51. data/ext/ffi_c/ffi.c +27 -20
  52. data/ext/ffi_c/libffi/.appveyor.yml +66 -0
  53. data/ext/ffi_c/libffi/.gitattributes +4 -0
  54. data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
  55. data/ext/ffi_c/libffi/.gitignore +38 -0
  56. data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
  57. data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
  58. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
  59. data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
  60. data/ext/ffi_c/libffi/.travis/build.sh +142 -0
  61. data/ext/ffi_c/libffi/.travis/compile +351 -0
  62. data/ext/ffi_c/libffi/.travis/install.sh +71 -0
  63. data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
  64. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
  65. data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
  66. data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
  67. data/ext/ffi_c/libffi/.travis/site.exp +27 -0
  68. data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
  69. data/ext/ffi_c/libffi/.travis.yml +83 -0
  70. data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6366 -3559
  71. data/ext/ffi_c/libffi/LICENSE +1 -1
  72. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
  73. data/ext/ffi_c/libffi/Makefile.am +123 -169
  74. data/ext/ffi_c/libffi/Makefile.in +1243 -1003
  75. data/ext/ffi_c/libffi/README.md +486 -0
  76. data/ext/ffi_c/libffi/acinclude.m4 +387 -0
  77. data/ext/ffi_c/libffi/autogen.sh +2 -0
  78. data/ext/ffi_c/libffi/config.guess +690 -504
  79. data/ext/ffi_c/libffi/config.sub +1353 -1207
  80. data/ext/ffi_c/libffi/configure +7308 -2449
  81. data/ext/ffi_c/libffi/configure.ac +178 -259
  82. data/ext/ffi_c/libffi/configure.host +311 -4
  83. data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
  84. data/ext/ffi_c/libffi/doc/Makefile.in +815 -0
  85. data/ext/ffi_c/libffi/doc/libffi.texi +455 -58
  86. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  87. data/ext/ffi_c/libffi/fficonfig.h.in +37 -13
  88. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +201 -0
  89. data/ext/ffi_c/libffi/include/Makefile.am +3 -3
  90. data/ext/ffi_c/libffi/include/Makefile.in +196 -75
  91. data/ext/ffi_c/libffi/include/ffi.h.in +163 -67
  92. data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
  93. data/ext/ffi_c/libffi/include/ffi_common.h +39 -12
  94. data/ext/ffi_c/libffi/install-sh +207 -209
  95. data/ext/ffi_c/libffi/libffi.map.in +76 -0
  96. data/ext/ffi_c/libffi/libffi.pc.in +3 -2
  97. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
  98. data/ext/ffi_c/libffi/libtool-ldflags +106 -0
  99. data/ext/ffi_c/libffi/libtool-version +1 -1
  100. data/ext/ffi_c/libffi/ltmain.sh +3641 -2026
  101. data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
  102. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
  103. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +32 -14
  104. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +33 -106
  105. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
  106. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +38 -13
  107. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +8 -29
  108. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +11 -9
  109. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +104 -52
  110. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +18 -8
  111. data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
  112. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  113. data/ext/ffi_c/libffi/man/Makefile.am +2 -2
  114. data/ext/ffi_c/libffi/man/Makefile.in +151 -55
  115. data/ext/ffi_c/libffi/man/ffi.3 +10 -0
  116. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
  117. data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
  118. data/ext/ffi_c/libffi/missing +153 -314
  119. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  120. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  121. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  122. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  123. data/ext/ffi_c/libffi/{include/ffi.h.vc64 → msvc_build/aarch64/aarch64_include/ffi.h} +151 -67
  124. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
  125. data/ext/ffi_c/libffi/msvcc.sh +176 -20
  126. data/ext/ffi_c/libffi/src/aarch64/ffi.c +1025 -0
  127. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
  128. data/ext/ffi_c/libffi/src/aarch64/internal.h +68 -0
  129. data/ext/ffi_c/libffi/src/aarch64/sysv.S +451 -0
  130. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  131. data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
  132. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
  133. data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
  134. data/ext/ffi_c/libffi/src/alpha/osf.S +161 -266
  135. data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
  136. data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
  137. data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
  138. data/ext/ffi_c/libffi/src/arm/ffi.c +663 -515
  139. data/ext/ffi_c/libffi/src/arm/ffitarget.h +32 -8
  140. data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
  141. data/ext/ffi_c/libffi/src/arm/sysv.S +305 -417
  142. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  143. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
  144. data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
  145. data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
  146. data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
  147. data/ext/ffi_c/libffi/src/closures.c +465 -59
  148. data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
  149. data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
  150. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  151. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  152. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  153. data/ext/ffi_c/libffi/src/debug.c +6 -1
  154. data/ext/ffi_c/libffi/src/dlmalloc.c +17 -12
  155. data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
  156. data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
  157. data/ext/ffi_c/libffi/src/ia64/ffi.c +35 -13
  158. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +8 -2
  159. data/ext/ffi_c/libffi/src/ia64/unix.S +8 -1
  160. data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
  161. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  162. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  163. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  164. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  165. data/ext/ffi_c/libffi/src/m32r/ffi.c +1 -1
  166. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
  167. data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
  168. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
  169. data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
  170. data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
  171. data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
  172. data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
  173. data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
  174. data/ext/ffi_c/libffi/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
  175. data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
  176. data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
  177. data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
  178. data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
  179. data/ext/ffi_c/libffi/src/mips/ffi.c +135 -37
  180. data/ext/ffi_c/libffi/src/mips/ffitarget.h +16 -14
  181. data/ext/ffi_c/libffi/src/mips/n32.S +128 -56
  182. data/ext/ffi_c/libffi/src/mips/o32.S +150 -27
  183. data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
  184. data/ext/ffi_c/libffi/src/moxie/ffi.c +55 -46
  185. data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
  186. data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
  187. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
  188. data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
  189. data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
  190. data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
  191. data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
  192. data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
  193. data/ext/ffi_c/libffi/src/pa/ffitarget.h +9 -7
  194. data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
  195. data/ext/ffi_c/libffi/src/pa/linux.S +27 -4
  196. data/ext/ffi_c/libffi/src/powerpc/aix.S +245 -7
  197. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +253 -4
  198. data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
  199. data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
  200. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
  201. data/ext/ffi_c/libffi/src/powerpc/ffi.c +105 -1378
  202. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +123 -30
  203. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
  204. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
  205. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
  206. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +110 -45
  207. data/ext/ffi_c/libffi/src/powerpc/linux64.S +189 -85
  208. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +436 -108
  209. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
  210. data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
  211. data/ext/ffi_c/libffi/src/prep_cif.c +111 -25
  212. data/ext/ffi_c/libffi/src/raw_api.c +18 -5
  213. data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -0
  214. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
  215. data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
  216. data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
  217. data/ext/ffi_c/libffi/src/s390/ffitarget.h +9 -1
  218. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  219. data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
  220. data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
  221. data/ext/ffi_c/libffi/src/sh/ffitarget.h +6 -1
  222. data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
  223. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
  224. data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
  225. data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
  226. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
  227. data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
  228. data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
  229. data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
  230. data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
  231. data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
  232. data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
  233. data/ext/ffi_c/libffi/src/types.c +46 -15
  234. data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
  235. data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
  236. data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
  237. data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
  238. data/ext/ffi_c/libffi/src/x86/ffi.c +624 -498
  239. data/ext/ffi_c/libffi/src/x86/ffi64.c +379 -119
  240. data/ext/ffi_c/libffi/src/x86/ffitarget.h +74 -35
  241. data/ext/ffi_c/libffi/src/x86/ffiw64.c +318 -0
  242. data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
  243. data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
  244. data/ext/ffi_c/libffi/src/x86/sysv.S +1070 -400
  245. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
  246. data/ext/ffi_c/libffi/src/x86/unix64.S +494 -299
  247. data/ext/ffi_c/libffi/src/x86/win64.S +231 -458
  248. data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
  249. data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
  250. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
  251. data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
  252. data/ext/ffi_c/libffi/stamp-h.in +1 -0
  253. data/ext/ffi_c/libffi/testsuite/Makefile.am +115 -73
  254. data/ext/ffi_c/libffi/testsuite/Makefile.in +262 -114
  255. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +334 -24
  256. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +21 -1
  257. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
  258. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
  259. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
  260. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
  261. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1745 -0
  262. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
  263. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -0
  264. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
  265. data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
  266. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -6
  267. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
  268. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +25 -40
  269. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
  270. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
  271. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
  272. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
  273. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
  274. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
  275. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
  276. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
  277. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
  278. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
  279. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
  280. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
  281. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
  282. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
  283. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
  284. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +2 -2
  285. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
  286. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
  287. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
  288. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
  289. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
  290. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
  291. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
  292. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
  293. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
  294. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
  295. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
  296. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
  297. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
  298. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
  299. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
  300. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
  301. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
  302. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
  303. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  304. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
  305. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
  306. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
  307. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
  308. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
  309. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
  310. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
  311. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
  312. data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +7 -16
  313. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +4 -4
  314. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +4 -4
  315. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +4 -4
  316. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +4 -4
  317. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -4
  318. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +4 -4
  319. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +4 -4
  320. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +5 -5
  321. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +4 -4
  322. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +4 -4
  323. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +4 -4
  324. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +4 -4
  325. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +95 -0
  326. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +4 -4
  327. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +4 -4
  328. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +4 -4
  329. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +4 -4
  330. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +5 -5
  331. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +4 -4
  332. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +4 -4
  333. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +4 -4
  334. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +4 -4
  335. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +4 -4
  336. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +4 -4
  337. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +4 -4
  338. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +4 -4
  339. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +4 -4
  340. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +4 -4
  341. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +4 -6
  342. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +4 -6
  343. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +4 -4
  344. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +4 -4
  345. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +4 -4
  346. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +4 -4
  347. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +4 -4
  348. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +4 -4
  349. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +4 -4
  350. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +4 -4
  351. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  352. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +10 -9
  353. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
  354. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +3 -3
  355. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +10 -9
  356. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
  357. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -0
  358. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
  359. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
  360. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
  361. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
  362. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
  363. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
  364. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +1 -1
  365. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +11 -9
  366. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
  367. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
  368. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
  369. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +114 -0
  370. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
  371. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +44 -0
  372. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
  373. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +45 -0
  374. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +45 -0
  375. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +5 -5
  376. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
  377. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +44 -0
  378. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  379. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
  380. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +20 -19
  381. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +6 -6
  382. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +8 -8
  383. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +7 -6
  384. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +121 -0
  385. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +5 -5
  386. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +5 -5
  387. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +5 -5
  388. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +5 -5
  389. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +6 -6
  390. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +5 -5
  391. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +6 -6
  392. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +6 -6
  393. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  394. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +7 -7
  395. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
  396. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +5 -5
  397. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +5 -5
  398. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +2 -2
  399. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +3 -10
  400. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +3 -2
  401. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
  402. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
  403. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
  404. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
  405. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
  406. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
  407. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
  408. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
  409. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
  410. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
  411. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
  412. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
  413. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
  414. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
  415. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
  416. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
  417. data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -8
  418. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
  419. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
  420. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
  421. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
  422. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
  423. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
  424. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
  425. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
  426. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
  427. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
  428. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
  429. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
  430. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
  431. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
  432. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
  433. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
  434. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
  435. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
  436. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
  437. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
  438. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
  439. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
  440. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
  441. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
  442. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
  443. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
  444. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
  445. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
  446. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
  447. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
  448. data/ext/ffi_c/libffi.bsd.mk +12 -6
  449. data/ext/ffi_c/libffi.darwin.mk +21 -9
  450. data/ext/ffi_c/libffi.gnu.mk +3 -2
  451. data/ext/ffi_c/libffi.mk +11 -6
  452. data/ext/ffi_c/libffi.vc.mk +1 -1
  453. data/ext/ffi_c/libffi.vc64.mk +1 -1
  454. data/ext/ffi_c/rbffi.h +22 -14
  455. data/ext/ffi_c/rbffi_endian.h +11 -2
  456. data/ffi.gemspec +42 -0
  457. data/lib/ffi/abstract_memory.rb +44 -0
  458. data/lib/ffi/autopointer.rb +70 -50
  459. data/lib/ffi/data_converter.rb +67 -0
  460. data/lib/ffi/enum.rb +159 -24
  461. data/lib/ffi/errno.rb +21 -11
  462. data/lib/ffi/ffi.rb +25 -11
  463. data/lib/ffi/io.rb +24 -14
  464. data/lib/ffi/library.rb +174 -67
  465. data/lib/ffi/managedstruct.rb +63 -34
  466. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  467. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  468. data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
  469. data/lib/ffi/platform/aarch64-linux/types.conf +104 -0
  470. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  471. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  472. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  473. data/lib/ffi/platform/arm-linux/types.conf +110 -82
  474. data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  475. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  476. data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
  477. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  478. data/lib/ffi/platform/{i486-gnu → i386-gnu}/types.conf +84 -84
  479. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  480. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  481. data/lib/ffi/platform/i386-openbsd/types.conf +89 -87
  482. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  483. data/lib/ffi/platform/i386-windows/types.conf +43 -96
  484. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  485. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  486. data/lib/ffi/platform/mips64-linux/types.conf +104 -0
  487. data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  488. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  489. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
  490. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
  491. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
  492. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
  493. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  494. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  495. data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
  496. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  497. data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  498. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  499. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  500. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  501. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  502. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  503. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  504. data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
  505. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  506. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  507. data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  508. data/lib/ffi/platform/x86_64-darwin/types.conf +93 -63
  509. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  510. data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -88
  511. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  512. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  513. data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
  514. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  515. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -87
  516. data/lib/ffi/platform/x86_64-openbsd/types.conf +100 -92
  517. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  518. data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
  519. data/lib/ffi/platform.rb +81 -26
  520. data/lib/ffi/pointer.rb +72 -27
  521. data/lib/ffi/struct.rb +99 -66
  522. data/lib/ffi/struct_by_reference.rb +72 -0
  523. data/lib/ffi/struct_layout.rb +96 -0
  524. data/lib/ffi/struct_layout_builder.rb +82 -17
  525. data/lib/ffi/tools/const_generator.rb +11 -8
  526. data/lib/ffi/tools/generator.rb +48 -1
  527. data/lib/ffi/tools/generator_task.rb +13 -16
  528. data/lib/ffi/tools/struct_generator.rb +6 -5
  529. data/lib/ffi/tools/types_generator.rb +14 -10
  530. data/lib/ffi/types.rb +31 -14
  531. data/lib/ffi/union.rb +23 -12
  532. data/lib/ffi/variadic.rb +25 -21
  533. data/lib/ffi/version.rb +3 -0
  534. data/lib/ffi.rb +20 -8
  535. data/rakelib/ffi_gem_helper.rb +65 -0
  536. data/samples/getlogin.rb +8 -0
  537. data/samples/getpid.rb +8 -0
  538. data/samples/gettimeofday.rb +18 -0
  539. data/samples/hello.rb +8 -0
  540. data/samples/inotify.rb +60 -0
  541. data/samples/pty.rb +75 -0
  542. data/samples/qsort.rb +20 -0
  543. metadata +413 -263
  544. data/History.txt +0 -1
  545. data/README.rdoc +0 -102
  546. data/ext/ffi_c/DataConverter.c +0 -91
  547. data/ext/ffi_c/Ffi_c.iml +0 -12
  548. data/ext/ffi_c/StructByReference.c +0 -158
  549. data/ext/ffi_c/StructByReference.h +0 -50
  550. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  551. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  552. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  553. data/ext/ffi_c/libffi/Makefile.vc +0 -141
  554. data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
  555. data/ext/ffi_c/libffi/README +0 -342
  556. data/ext/ffi_c/libffi/aclocal.m4 +0 -1873
  557. data/ext/ffi_c/libffi/build-ios.sh +0 -67
  558. data/ext/ffi_c/libffi/compile +0 -143
  559. data/ext/ffi_c/libffi/depcomp +0 -630
  560. data/ext/ffi_c/libffi/doc/libffi.info +0 -593
  561. data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
  562. data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
  563. data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +0 -76
  564. data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7831
  565. data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -369
  566. data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
  567. data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
  568. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -98
  569. data/ext/ffi_c/libffi/mdate-sh +0 -201
  570. data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
  571. data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
  572. data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
  573. data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
  574. data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
  575. data/ext/ffi_c/libffi/src/x86/win32.S +0 -1065
  576. data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
  577. data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
  578. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
  579. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
  580. data/ext/ffi_c/libffi/texinfo.tex +0 -7210
  581. data/ext/ffi_c/win32/stdint.h +0 -199
  582. data/gen/Rakefile +0 -30
  583. data/gen/log +0 -1
  584. data/lib/Lib.iml +0 -13
  585. data/spec/ffi/Ffi.iml +0 -12
  586. data/spec/ffi/async_callback_spec.rb +0 -46
  587. data/spec/ffi/bool_spec.rb +0 -40
  588. data/spec/ffi/buffer_spec.rb +0 -215
  589. data/spec/ffi/callback_spec.rb +0 -668
  590. data/spec/ffi/custom_param_type.rb +0 -47
  591. data/spec/ffi/custom_type_spec.rb +0 -85
  592. data/spec/ffi/dup_spec.rb +0 -65
  593. data/spec/ffi/enum_spec.rb +0 -227
  594. data/spec/ffi/errno_spec.rb +0 -29
  595. data/spec/ffi/ffi_spec.rb +0 -40
  596. data/spec/ffi/function_spec.rb +0 -87
  597. data/spec/ffi/library_spec.rb +0 -208
  598. data/spec/ffi/long_double.rb +0 -41
  599. data/spec/ffi/managed_struct_spec.rb +0 -72
  600. data/spec/ffi/number_spec.rb +0 -247
  601. data/spec/ffi/pointer_spec.rb +0 -214
  602. data/spec/ffi/rbx/attach_function_spec.rb +0 -28
  603. data/spec/ffi/rbx/memory_pointer_spec.rb +0 -115
  604. data/spec/ffi/rbx/spec_helper.rb +0 -1
  605. data/spec/ffi/rbx/struct_spec.rb +0 -13
  606. data/spec/ffi/spec_helper.rb +0 -35
  607. data/spec/ffi/string_spec.rb +0 -119
  608. data/spec/ffi/strptr_spec.rb +0 -61
  609. data/spec/ffi/struct_callback_spec.rb +0 -80
  610. data/spec/ffi/struct_initialize_spec.rb +0 -46
  611. data/spec/ffi/struct_packed_spec.rb +0 -62
  612. data/spec/ffi/struct_spec.rb +0 -719
  613. data/spec/ffi/typedef_spec.rb +0 -89
  614. data/spec/ffi/union_spec.rb +0 -76
  615. data/spec/ffi/variadic_spec.rb +0 -103
  616. data/spec/spec.opts +0 -4
  617. data/tasks/ann.rake +0 -80
  618. data/tasks/extension.rake +0 -32
  619. data/tasks/gem.rake +0 -199
  620. data/tasks/git.rake +0 -41
  621. data/tasks/notes.rake +0 -27
  622. data/tasks/post_load.rake +0 -34
  623. data/tasks/rdoc.rake +0 -50
  624. data/tasks/rubyforge.rake +0 -55
  625. data/tasks/setup.rb +0 -301
  626. data/tasks/spec.rake +0 -54
  627. data/tasks/svn.rake +0 -47
  628. data/tasks/test.rake +0 -40
  629. data/tasks/yard.rake +0 -11
@@ -1,5 +1,7 @@
1
1
  /* -----------------------------------------------------------------------
2
- sysv.S - Copyright (c) 1996, 1998, 2001-2003, 2005, 2008, 2010 Red Hat, Inc.
2
+ sysv.S - Copyright (c) 2017 Anthony Green
3
+ - Copyright (c) 2013 The Written Word, Inc.
4
+ - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
3
5
 
4
6
  X86 Foreign Function Interface
5
7
 
@@ -24,444 +26,1112 @@
24
26
  DEALINGS IN THE SOFTWARE.
25
27
  ----------------------------------------------------------------------- */
26
28
 
27
- #ifndef __x86_64__
29
+ #ifdef __i386__
30
+ #ifndef _MSC_VER
28
31
 
29
32
  #define LIBFFI_ASM
30
33
  #include <fficonfig.h>
31
34
  #include <ffi.h>
35
+ #include "internal.h"
32
36
 
33
- .text
34
-
35
- .globl ffi_prep_args
36
-
37
- .align 4
38
- .globl ffi_call_SYSV
39
- .type ffi_call_SYSV,@function
40
-
41
- ffi_call_SYSV:
42
- .LFB1:
43
- pushl %ebp
44
- .LCFI0:
45
- movl %esp,%ebp
46
- .LCFI1:
47
- /* Make room for all of the new args. */
48
- movl 16(%ebp),%ecx
49
- subl %ecx,%esp
50
-
51
- /* Align the stack pointer to 16-bytes */
52
- andl $0xfffffff0, %esp
53
-
54
- movl %esp,%eax
55
-
56
- /* Place all of the ffi_prep_args in position */
57
- pushl 12(%ebp)
58
- pushl %eax
59
- call *8(%ebp)
60
-
61
- /* Return stack to previous state and call the function */
62
- addl $8,%esp
63
-
64
- call *28(%ebp)
65
-
66
- /* Load %ecx with the return type code */
67
- movl 20(%ebp),%ecx
68
-
69
- /* Protect %esi. We're going to pop it in the epilogue. */
70
- pushl %esi
71
-
72
- /* If the return value pointer is NULL, assume no return value. */
73
- cmpl $0,24(%ebp)
74
- jne 0f
75
-
76
- /* Even if there is no space for the return value, we are
77
- obliged to handle floating-point values. */
78
- cmpl $FFI_TYPE_FLOAT,%ecx
79
- jne noretval
80
- fstp %st(0)
81
-
82
- jmp epilogue
83
-
84
- 0:
85
- call 1f
86
-
87
- .Lstore_table:
88
- .long noretval-.Lstore_table /* FFI_TYPE_VOID */
89
- .long retint-.Lstore_table /* FFI_TYPE_INT */
90
- .long retfloat-.Lstore_table /* FFI_TYPE_FLOAT */
91
- .long retdouble-.Lstore_table /* FFI_TYPE_DOUBLE */
92
- .long retlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
93
- .long retuint8-.Lstore_table /* FFI_TYPE_UINT8 */
94
- .long retsint8-.Lstore_table /* FFI_TYPE_SINT8 */
95
- .long retuint16-.Lstore_table /* FFI_TYPE_UINT16 */
96
- .long retsint16-.Lstore_table /* FFI_TYPE_SINT16 */
97
- .long retint-.Lstore_table /* FFI_TYPE_UINT32 */
98
- .long retint-.Lstore_table /* FFI_TYPE_SINT32 */
99
- .long retint64-.Lstore_table /* FFI_TYPE_UINT64 */
100
- .long retint64-.Lstore_table /* FFI_TYPE_SINT64 */
101
- .long retstruct-.Lstore_table /* FFI_TYPE_STRUCT */
102
- .long retint-.Lstore_table /* FFI_TYPE_POINTER */
103
-
104
- 1:
105
- pop %esi
106
- add (%esi, %ecx, 4), %esi
107
- jmp *%esi
108
-
109
- /* Sign/zero extend as appropriate. */
110
- retsint8:
111
- movsbl %al, %eax
112
- jmp retint
37
+ #define C2(X, Y) X ## Y
38
+ #define C1(X, Y) C2(X, Y)
39
+ #ifdef __USER_LABEL_PREFIX__
40
+ # define C(X) C1(__USER_LABEL_PREFIX__, X)
41
+ #else
42
+ # define C(X) X
43
+ #endif
113
44
 
114
- retsint16:
115
- movswl %ax, %eax
116
- jmp retint
45
+ #ifdef X86_DARWIN
46
+ # define L(X) C1(L, X)
47
+ #else
48
+ # define L(X) C1(.L, X)
49
+ #endif
117
50
 
118
- retuint8:
119
- movzbl %al, %eax
120
- jmp retint
51
+ #ifdef __ELF__
52
+ # define ENDF(X) .type X,@function; .size X, . - X
53
+ #else
54
+ # define ENDF(X)
55
+ #endif
121
56
 
122
- retuint16:
123
- movzwl %ax, %eax
124
- jmp retint
125
-
126
- retfloat:
127
- /* Load %ecx with the pointer to storage for the return value */
128
- movl 24(%ebp),%ecx
129
- fstps (%ecx)
130
- jmp epilogue
131
-
132
- retdouble:
133
- /* Load %ecx with the pointer to storage for the return value */
134
- movl 24(%ebp),%ecx
135
- fstpl (%ecx)
136
- jmp epilogue
137
-
138
- retlongdouble:
139
- /* Load %ecx with the pointer to storage for the return value */
140
- movl 24(%ebp),%ecx
141
- fstpt (%ecx)
142
- jmp epilogue
143
-
144
- retint64:
145
- /* Load %ecx with the pointer to storage for the return value */
146
- movl 24(%ebp),%ecx
147
- movl %eax,0(%ecx)
148
- movl %edx,4(%ecx)
149
- jmp epilogue
150
-
151
- retint:
152
- /* Load %ecx with the pointer to storage for the return value */
153
- movl 24(%ebp),%ecx
154
- movl %eax,0(%ecx)
155
-
156
- retstruct:
157
- /* Nothing to do! */
158
-
159
- noretval:
160
- epilogue:
161
- popl %esi
162
- movl %ebp,%esp
163
- popl %ebp
164
- ret
165
- .LFE1:
166
- .ffi_call_SYSV_end:
167
- .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
168
-
169
- .align 4
170
- FFI_HIDDEN (ffi_closure_SYSV)
171
- .globl ffi_closure_SYSV
172
- .type ffi_closure_SYSV, @function
173
-
174
- ffi_closure_SYSV:
175
- .LFB2:
176
- pushl %ebp
177
- .LCFI2:
178
- movl %esp, %ebp
179
- .LCFI3:
180
- subl $40, %esp
181
- leal -24(%ebp), %edx
182
- movl %edx, -12(%ebp) /* resp */
183
- leal 8(%ebp), %edx
184
- movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
185
- leal -12(%ebp), %edx
186
- movl %edx, (%esp) /* &resp */
187
- #if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__
188
- call ffi_closure_SYSV_inner
57
+ /* Handle win32 fastcall name mangling. */
58
+ #ifdef X86_WIN32
59
+ # define ffi_call_i386 "@ffi_call_i386@8"
60
+ # define ffi_closure_inner "@ffi_closure_inner@8"
189
61
  #else
190
- movl %ebx, 8(%esp)
191
- .LCFI7:
192
- call 1f
193
- 1: popl %ebx
194
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
195
- call ffi_closure_SYSV_inner@PLT
196
- movl 8(%esp), %ebx
62
+ # define ffi_call_i386 C(ffi_call_i386)
63
+ # define ffi_closure_inner C(ffi_closure_inner)
197
64
  #endif
198
- movl -12(%ebp), %ecx
199
- cmpl $FFI_TYPE_INT, %eax
200
- je .Lcls_retint
201
-
202
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
203
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
204
- cmpl $FFI_TYPE_UINT64, %eax
205
- jge 0f
206
- cmpl $FFI_TYPE_UINT8, %eax
207
- jge .Lcls_retint
208
-
209
- 0: cmpl $FFI_TYPE_FLOAT, %eax
210
- je .Lcls_retfloat
211
- cmpl $FFI_TYPE_DOUBLE, %eax
212
- je .Lcls_retdouble
213
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
214
- je .Lcls_retldouble
215
- cmpl $FFI_TYPE_SINT64, %eax
216
- je .Lcls_retllong
217
- cmpl $FFI_TYPE_STRUCT, %eax
218
- je .Lcls_retstruct
219
- .Lcls_epilogue:
220
- movl %ebp, %esp
221
- popl %ebp
222
- ret
223
- .Lcls_retint:
224
- movl (%ecx), %eax
225
- jmp .Lcls_epilogue
226
- .Lcls_retfloat:
227
- flds (%ecx)
228
- jmp .Lcls_epilogue
229
- .Lcls_retdouble:
230
- fldl (%ecx)
231
- jmp .Lcls_epilogue
232
- .Lcls_retldouble:
233
- fldt (%ecx)
234
- jmp .Lcls_epilogue
235
- .Lcls_retllong:
236
- movl (%ecx), %eax
237
- movl 4(%ecx), %edx
238
- jmp .Lcls_epilogue
239
- .Lcls_retstruct:
240
- movl %ebp, %esp
241
- popl %ebp
242
- ret $4
243
- .LFE2:
244
- .size ffi_closure_SYSV, .-ffi_closure_SYSV
245
65
 
246
- #if !FFI_NO_RAW_API
66
+ /* This macro allows the safe creation of jump tables without an
67
+ actual table. The entry points into the table are all 8 bytes.
68
+ The use of ORG asserts that we're at the correct location. */
69
+ /* ??? The clang assembler doesn't handle .org with symbolic expressions. */
70
+ #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
71
+ # define E(BASE, X) .balign 8
72
+ #else
73
+ # define E(BASE, X) .balign 8; .org BASE + X * 8
74
+ #endif
247
75
 
248
- /* Precalculate for e.g. the Solaris 10/x86 assembler. */
249
- #if FFI_TRAMPOLINE_SIZE == 10
250
- #define RAW_CLOSURE_CIF_OFFSET 12
251
- #define RAW_CLOSURE_FUN_OFFSET 16
252
- #define RAW_CLOSURE_USER_DATA_OFFSET 20
253
- #elif FFI_TRAMPOLINE_SIZE == 24
254
- #define RAW_CLOSURE_CIF_OFFSET 24
255
- #define RAW_CLOSURE_FUN_OFFSET 28
256
- #define RAW_CLOSURE_USER_DATA_OFFSET 32
76
+ .text
77
+ .balign 16
78
+ .globl ffi_call_i386
79
+ FFI_HIDDEN(ffi_call_i386)
80
+
81
+ /* This is declared as
82
+
83
+ void ffi_call_i386(struct call_frame *frame, char *argp)
84
+ __attribute__((fastcall));
85
+
86
+ Thus the arguments are present in
87
+
88
+ ecx: frame
89
+ edx: argp
90
+ */
91
+
92
+ ffi_call_i386:
93
+ L(UW0):
94
+ # cfi_startproc
95
+ _CET_ENDBR
96
+ #if !HAVE_FASTCALL
97
+ movl 4(%esp), %ecx
98
+ movl 8(%esp), %edx
99
+ #endif
100
+ movl (%esp), %eax /* move the return address */
101
+ movl %ebp, (%ecx) /* store %ebp into local frame */
102
+ movl %eax, 4(%ecx) /* store retaddr into local frame */
103
+
104
+ /* New stack frame based off ebp. This is a itty bit of unwind
105
+ trickery in that the CFA *has* changed. There is no easy way
106
+ to describe it correctly on entry to the function. Fortunately,
107
+ it doesn't matter too much since at all points we can correctly
108
+ unwind back to ffi_call. Note that the location to which we
109
+ moved the return address is (the new) CFA-4, so from the
110
+ perspective of the unwind info, it hasn't moved. */
111
+ movl %ecx, %ebp
112
+ L(UW1):
113
+ # cfi_def_cfa(%ebp, 8)
114
+ # cfi_rel_offset(%ebp, 0)
115
+
116
+ movl %edx, %esp /* set outgoing argument stack */
117
+ movl 20+R_EAX*4(%ebp), %eax /* set register arguments */
118
+ movl 20+R_EDX*4(%ebp), %edx
119
+ movl 20+R_ECX*4(%ebp), %ecx
120
+
121
+ call *8(%ebp)
122
+
123
+ movl 12(%ebp), %ecx /* load return type code */
124
+ movl %ebx, 8(%ebp) /* preserve %ebx */
125
+ L(UW2):
126
+ # cfi_rel_offset(%ebx, 8)
127
+
128
+ andl $X86_RET_TYPE_MASK, %ecx
129
+ #ifdef __PIC__
130
+ call C(__x86.get_pc_thunk.bx)
131
+ L(pc1):
132
+ leal L(store_table)-L(pc1)(%ebx, %ecx, 8), %ebx
257
133
  #else
258
- #define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
259
- #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
260
- #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
134
+ leal L(store_table)(,%ecx, 8), %ebx
261
135
  #endif
262
- #define CIF_FLAGS_OFFSET 20
263
-
264
- .align 4
265
- FFI_HIDDEN (ffi_closure_raw_SYSV)
266
- .globl ffi_closure_raw_SYSV
267
- .type ffi_closure_raw_SYSV, @function
268
-
269
- ffi_closure_raw_SYSV:
270
- .LFB3:
271
- pushl %ebp
272
- .LCFI4:
273
- movl %esp, %ebp
274
- .LCFI5:
275
- pushl %esi
276
- .LCFI6:
277
- subl $36, %esp
278
- movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
279
- movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
280
- movl %edx, 12(%esp) /* user_data */
281
- leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */
282
- movl %edx, 8(%esp) /* raw_args */
283
- leal -24(%ebp), %edx
284
- movl %edx, 4(%esp) /* &res */
285
- movl %esi, (%esp) /* cif */
286
- call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */
287
- movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */
288
- cmpl $FFI_TYPE_INT, %eax
289
- je .Lrcls_retint
290
-
291
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
292
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
293
- cmpl $FFI_TYPE_UINT64, %eax
294
- jge 0f
295
- cmpl $FFI_TYPE_UINT8, %eax
296
- jge .Lrcls_retint
297
- 0:
298
- cmpl $FFI_TYPE_FLOAT, %eax
299
- je .Lrcls_retfloat
300
- cmpl $FFI_TYPE_DOUBLE, %eax
301
- je .Lrcls_retdouble
302
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
303
- je .Lrcls_retldouble
304
- cmpl $FFI_TYPE_SINT64, %eax
305
- je .Lrcls_retllong
306
- .Lrcls_epilogue:
307
- addl $36, %esp
308
- popl %esi
136
+ movl 16(%ebp), %ecx /* load result address */
137
+ _CET_NOTRACK jmp *%ebx
138
+
139
+ .balign 8
140
+ L(store_table):
141
+ E(L(store_table), X86_RET_FLOAT)
142
+ fstps (%ecx)
143
+ jmp L(e1)
144
+ E(L(store_table), X86_RET_DOUBLE)
145
+ fstpl (%ecx)
146
+ jmp L(e1)
147
+ E(L(store_table), X86_RET_LDOUBLE)
148
+ fstpt (%ecx)
149
+ jmp L(e1)
150
+ E(L(store_table), X86_RET_SINT8)
151
+ movsbl %al, %eax
152
+ mov %eax, (%ecx)
153
+ jmp L(e1)
154
+ E(L(store_table), X86_RET_SINT16)
155
+ movswl %ax, %eax
156
+ mov %eax, (%ecx)
157
+ jmp L(e1)
158
+ E(L(store_table), X86_RET_UINT8)
159
+ movzbl %al, %eax
160
+ mov %eax, (%ecx)
161
+ jmp L(e1)
162
+ E(L(store_table), X86_RET_UINT16)
163
+ movzwl %ax, %eax
164
+ mov %eax, (%ecx)
165
+ jmp L(e1)
166
+ E(L(store_table), X86_RET_INT64)
167
+ movl %edx, 4(%ecx)
168
+ /* fallthru */
169
+ E(L(store_table), X86_RET_INT32)
170
+ movl %eax, (%ecx)
171
+ /* fallthru */
172
+ E(L(store_table), X86_RET_VOID)
173
+ L(e1):
174
+ movl 8(%ebp), %ebx
175
+ movl %ebp, %esp
309
176
  popl %ebp
177
+ L(UW3):
178
+ # cfi_remember_state
179
+ # cfi_def_cfa(%esp, 4)
180
+ # cfi_restore(%ebx)
181
+ # cfi_restore(%ebp)
310
182
  ret
311
- .Lrcls_retint:
312
- movl -24(%ebp), %eax
313
- jmp .Lrcls_epilogue
314
- .Lrcls_retfloat:
315
- flds -24(%ebp)
316
- jmp .Lrcls_epilogue
317
- .Lrcls_retdouble:
318
- fldl -24(%ebp)
319
- jmp .Lrcls_epilogue
320
- .Lrcls_retldouble:
321
- fldt -24(%ebp)
322
- jmp .Lrcls_epilogue
323
- .Lrcls_retllong:
324
- movl -24(%ebp), %eax
325
- movl -20(%ebp), %edx
326
- jmp .Lrcls_epilogue
327
- .LFE3:
328
- .size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV
183
+ L(UW4):
184
+ # cfi_restore_state
185
+
186
+ E(L(store_table), X86_RET_STRUCTPOP)
187
+ jmp L(e1)
188
+ E(L(store_table), X86_RET_STRUCTARG)
189
+ jmp L(e1)
190
+ E(L(store_table), X86_RET_STRUCT_1B)
191
+ movb %al, (%ecx)
192
+ jmp L(e1)
193
+ E(L(store_table), X86_RET_STRUCT_2B)
194
+ movw %ax, (%ecx)
195
+ jmp L(e1)
196
+
197
+ /* Fill out the table so that bad values are predictable. */
198
+ E(L(store_table), X86_RET_UNUSED14)
199
+ ud2
200
+ E(L(store_table), X86_RET_UNUSED15)
201
+ ud2
202
+
203
+ L(UW5):
204
+ # cfi_endproc
205
+ ENDF(ffi_call_i386)
206
+
207
+ /* The inner helper is declared as
208
+
209
+ void ffi_closure_inner(struct closure_frame *frame, char *argp)
210
+ __attribute_((fastcall))
211
+
212
+ Thus the arguments are placed in
213
+
214
+ ecx: frame
215
+ edx: argp
216
+ */
217
+
218
+ /* Macros to help setting up the closure_data structure. */
219
+
220
+ #if HAVE_FASTCALL
221
+ # define closure_FS (40 + 4)
222
+ # define closure_CF 0
223
+ #else
224
+ # define closure_FS (8 + 40 + 12)
225
+ # define closure_CF 8
329
226
  #endif
330
227
 
331
- #if defined __PIC__
332
- # if defined __sun__ && defined __svr4__
333
- /* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22
334
- doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this. */
335
- # define FDE_ENCODING 0x30 /* datarel */
336
- # define FDE_ENCODE(X) X@GOTOFF
337
- # else
338
- # define FDE_ENCODING 0x1b /* pcrel sdata4 */
339
- # if defined HAVE_AS_X86_PCREL
340
- # define FDE_ENCODE(X) X-.
341
- # else
342
- # define FDE_ENCODE(X) X@rel
343
- # endif
344
- # endif
228
+ #define FFI_CLOSURE_SAVE_REGS \
229
+ movl %eax, closure_CF+16+R_EAX*4(%esp); \
230
+ movl %edx, closure_CF+16+R_EDX*4(%esp); \
231
+ movl %ecx, closure_CF+16+R_ECX*4(%esp)
232
+
233
+ #define FFI_CLOSURE_COPY_TRAMP_DATA \
234
+ movl FFI_TRAMPOLINE_SIZE(%eax), %edx; /* copy cif */ \
235
+ movl FFI_TRAMPOLINE_SIZE+4(%eax), %ecx; /* copy fun */ \
236
+ movl FFI_TRAMPOLINE_SIZE+8(%eax), %eax; /* copy user_data */ \
237
+ movl %edx, closure_CF+28(%esp); \
238
+ movl %ecx, closure_CF+32(%esp); \
239
+ movl %eax, closure_CF+36(%esp)
240
+
241
+ #if HAVE_FASTCALL
242
+ # define FFI_CLOSURE_PREP_CALL \
243
+ movl %esp, %ecx; /* load closure_data */ \
244
+ leal closure_FS+4(%esp), %edx; /* load incoming stack */
345
245
  #else
346
- # define FDE_ENCODING 0 /* absolute */
347
- # define FDE_ENCODE(X) X
246
+ # define FFI_CLOSURE_PREP_CALL \
247
+ leal closure_CF(%esp), %ecx; /* load closure_data */ \
248
+ leal closure_FS+4(%esp), %edx; /* load incoming stack */ \
249
+ movl %ecx, (%esp); \
250
+ movl %edx, 4(%esp)
348
251
  #endif
349
252
 
350
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
351
- .Lframe1:
352
- .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
353
- .LSCIE1:
354
- .long 0x0 /* CIE Identifier Tag */
355
- .byte 0x1 /* CIE Version */
356
- #ifdef HAVE_AS_ASCII_PSEUDO_OP
253
+ #define FFI_CLOSURE_CALL_INNER(UWN) \
254
+ call ffi_closure_inner
255
+
256
+ #define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \
257
+ andl $X86_RET_TYPE_MASK, %eax; \
258
+ leal L(C1(load_table,N))(, %eax, 8), %edx; \
259
+ movl closure_CF(%esp), %eax; /* optimiztic load */ \
260
+ _CET_NOTRACK jmp *%edx
261
+
357
262
  #ifdef __PIC__
358
- .ascii "zR\0" /* CIE Augmentation */
263
+ # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
264
+ # undef FFI_CLOSURE_MASK_AND_JUMP
265
+ # define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \
266
+ andl $X86_RET_TYPE_MASK, %eax; \
267
+ call C(__x86.get_pc_thunk.dx); \
268
+ L(C1(pc,N)): \
269
+ leal L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx; \
270
+ movl closure_CF(%esp), %eax; /* optimiztic load */ \
271
+ _CET_NOTRACK jmp *%edx
272
+ # else
273
+ # define FFI_CLOSURE_CALL_INNER_SAVE_EBX
274
+ # undef FFI_CLOSURE_CALL_INNER
275
+ # define FFI_CLOSURE_CALL_INNER(UWN) \
276
+ movl %ebx, 40(%esp); /* save ebx */ \
277
+ L(C1(UW,UWN)): \
278
+ /* cfi_rel_offset(%ebx, 40); */ \
279
+ call C(__x86.get_pc_thunk.bx); /* load got register */ \
280
+ addl $C(_GLOBAL_OFFSET_TABLE_), %ebx; \
281
+ call ffi_closure_inner@PLT
282
+ # undef FFI_CLOSURE_MASK_AND_JUMP
283
+ # define FFI_CLOSURE_MASK_AND_JUMP(N, UWN) \
284
+ andl $X86_RET_TYPE_MASK, %eax; \
285
+ leal L(C1(load_table,N))@GOTOFF(%ebx, %eax, 8), %edx; \
286
+ movl 40(%esp), %ebx; /* restore ebx */ \
287
+ L(C1(UW,UWN)): \
288
+ /* cfi_restore(%ebx); */ \
289
+ movl closure_CF(%esp), %eax; /* optimiztic load */ \
290
+ _CET_NOTRACK jmp *%edx
291
+ # endif /* DARWIN || HIDDEN */
292
+ #endif /* __PIC__ */
293
+
294
+ .balign 16
295
+ .globl C(ffi_go_closure_EAX)
296
+ FFI_HIDDEN(C(ffi_go_closure_EAX))
297
+ C(ffi_go_closure_EAX):
298
+ L(UW6):
299
+ # cfi_startproc
300
+ _CET_ENDBR
301
+ subl $closure_FS, %esp
302
+ L(UW7):
303
+ # cfi_def_cfa_offset(closure_FS + 4)
304
+ FFI_CLOSURE_SAVE_REGS
305
+ movl 4(%eax), %edx /* copy cif */
306
+ movl 8(%eax), %ecx /* copy fun */
307
+ movl %edx, closure_CF+28(%esp)
308
+ movl %ecx, closure_CF+32(%esp)
309
+ movl %eax, closure_CF+36(%esp) /* closure is user_data */
310
+ jmp L(do_closure_i386)
311
+ L(UW8):
312
+ # cfi_endproc
313
+ ENDF(C(ffi_go_closure_EAX))
314
+
315
+ .balign 16
316
+ .globl C(ffi_go_closure_ECX)
317
+ FFI_HIDDEN(C(ffi_go_closure_ECX))
318
+ C(ffi_go_closure_ECX):
319
+ L(UW9):
320
+ # cfi_startproc
321
+ _CET_ENDBR
322
+ subl $closure_FS, %esp
323
+ L(UW10):
324
+ # cfi_def_cfa_offset(closure_FS + 4)
325
+ FFI_CLOSURE_SAVE_REGS
326
+ movl 4(%ecx), %edx /* copy cif */
327
+ movl 8(%ecx), %eax /* copy fun */
328
+ movl %edx, closure_CF+28(%esp)
329
+ movl %eax, closure_CF+32(%esp)
330
+ movl %ecx, closure_CF+36(%esp) /* closure is user_data */
331
+ jmp L(do_closure_i386)
332
+ L(UW11):
333
+ # cfi_endproc
334
+ ENDF(C(ffi_go_closure_ECX))
335
+
336
+ /* The closure entry points are reached from the ffi_closure trampoline.
337
+ On entry, %eax contains the address of the ffi_closure. */
338
+
339
+ .balign 16
340
+ .globl C(ffi_closure_i386)
341
+ FFI_HIDDEN(C(ffi_closure_i386))
342
+
343
+ C(ffi_closure_i386):
344
+ L(UW12):
345
+ # cfi_startproc
346
+ _CET_ENDBR
347
+ subl $closure_FS, %esp
348
+ L(UW13):
349
+ # cfi_def_cfa_offset(closure_FS + 4)
350
+
351
+ FFI_CLOSURE_SAVE_REGS
352
+ FFI_CLOSURE_COPY_TRAMP_DATA
353
+
354
+ /* Entry point from preceeding Go closures. */
355
+ L(do_closure_i386):
356
+
357
+ FFI_CLOSURE_PREP_CALL
358
+ FFI_CLOSURE_CALL_INNER(14)
359
+ FFI_CLOSURE_MASK_AND_JUMP(2, 15)
360
+
361
+ .balign 8
362
+ L(load_table2):
363
+ E(L(load_table2), X86_RET_FLOAT)
364
+ flds closure_CF(%esp)
365
+ jmp L(e2)
366
+ E(L(load_table2), X86_RET_DOUBLE)
367
+ fldl closure_CF(%esp)
368
+ jmp L(e2)
369
+ E(L(load_table2), X86_RET_LDOUBLE)
370
+ fldt closure_CF(%esp)
371
+ jmp L(e2)
372
+ E(L(load_table2), X86_RET_SINT8)
373
+ movsbl %al, %eax
374
+ jmp L(e2)
375
+ E(L(load_table2), X86_RET_SINT16)
376
+ movswl %ax, %eax
377
+ jmp L(e2)
378
+ E(L(load_table2), X86_RET_UINT8)
379
+ movzbl %al, %eax
380
+ jmp L(e2)
381
+ E(L(load_table2), X86_RET_UINT16)
382
+ movzwl %ax, %eax
383
+ jmp L(e2)
384
+ E(L(load_table2), X86_RET_INT64)
385
+ movl closure_CF+4(%esp), %edx
386
+ jmp L(e2)
387
+ E(L(load_table2), X86_RET_INT32)
388
+ nop
389
+ /* fallthru */
390
+ E(L(load_table2), X86_RET_VOID)
391
+ L(e2):
392
+ addl $closure_FS, %esp
393
+ L(UW16):
394
+ # cfi_adjust_cfa_offset(-closure_FS)
395
+ ret
396
+ L(UW17):
397
+ # cfi_adjust_cfa_offset(closure_FS)
398
+ E(L(load_table2), X86_RET_STRUCTPOP)
399
+ addl $closure_FS, %esp
400
+ L(UW18):
401
+ # cfi_adjust_cfa_offset(-closure_FS)
402
+ ret $4
403
+ L(UW19):
404
+ # cfi_adjust_cfa_offset(closure_FS)
405
+ E(L(load_table2), X86_RET_STRUCTARG)
406
+ jmp L(e2)
407
+ E(L(load_table2), X86_RET_STRUCT_1B)
408
+ movzbl %al, %eax
409
+ jmp L(e2)
410
+ E(L(load_table2), X86_RET_STRUCT_2B)
411
+ movzwl %ax, %eax
412
+ jmp L(e2)
413
+
414
+ /* Fill out the table so that bad values are predictable. */
415
+ E(L(load_table2), X86_RET_UNUSED14)
416
+ ud2
417
+ E(L(load_table2), X86_RET_UNUSED15)
418
+ ud2
419
+
420
+ L(UW20):
421
+ # cfi_endproc
422
+ ENDF(C(ffi_closure_i386))
423
+
424
+ .balign 16
425
+ .globl C(ffi_go_closure_STDCALL)
426
+ FFI_HIDDEN(C(ffi_go_closure_STDCALL))
427
+ C(ffi_go_closure_STDCALL):
428
+ L(UW21):
429
+ # cfi_startproc
430
+ _CET_ENDBR
431
+ subl $closure_FS, %esp
432
+ L(UW22):
433
+ # cfi_def_cfa_offset(closure_FS + 4)
434
+ FFI_CLOSURE_SAVE_REGS
435
+ movl 4(%ecx), %edx /* copy cif */
436
+ movl 8(%ecx), %eax /* copy fun */
437
+ movl %edx, closure_CF+28(%esp)
438
+ movl %eax, closure_CF+32(%esp)
439
+ movl %ecx, closure_CF+36(%esp) /* closure is user_data */
440
+ jmp L(do_closure_STDCALL)
441
+ L(UW23):
442
+ # cfi_endproc
443
+ ENDF(C(ffi_go_closure_STDCALL))
444
+
445
+ /* For REGISTER, we have no available parameter registers, and so we
446
+ enter here having pushed the closure onto the stack. */
447
+
448
+ .balign 16
449
+ .globl C(ffi_closure_REGISTER)
450
+ FFI_HIDDEN(C(ffi_closure_REGISTER))
451
+ C(ffi_closure_REGISTER):
452
+ L(UW24):
453
+ # cfi_startproc
454
+ # cfi_def_cfa(%esp, 8)
455
+ # cfi_offset(%eip, -8)
456
+ _CET_ENDBR
457
+ subl $closure_FS-4, %esp
458
+ L(UW25):
459
+ # cfi_def_cfa_offset(closure_FS + 4)
460
+ FFI_CLOSURE_SAVE_REGS
461
+ movl closure_FS-4(%esp), %ecx /* load retaddr */
462
+ movl closure_FS(%esp), %eax /* load closure */
463
+ movl %ecx, closure_FS(%esp) /* move retaddr */
464
+ jmp L(do_closure_REGISTER)
465
+ L(UW26):
466
+ # cfi_endproc
467
+ ENDF(C(ffi_closure_REGISTER))
468
+
469
+ /* For STDCALL (and others), we need to pop N bytes of arguments off
470
+ the stack following the closure. The amount needing to be popped
471
+ is returned to us from ffi_closure_inner. */
472
+
473
+ .balign 16
474
+ .globl C(ffi_closure_STDCALL)
475
+ FFI_HIDDEN(C(ffi_closure_STDCALL))
476
+ C(ffi_closure_STDCALL):
477
+ L(UW27):
478
+ # cfi_startproc
479
+ _CET_ENDBR
480
+ subl $closure_FS, %esp
481
+ L(UW28):
482
+ # cfi_def_cfa_offset(closure_FS + 4)
483
+
484
+ FFI_CLOSURE_SAVE_REGS
485
+
486
+ /* Entry point from ffi_closure_REGISTER. */
487
+ L(do_closure_REGISTER):
488
+
489
+ FFI_CLOSURE_COPY_TRAMP_DATA
490
+
491
+ /* Entry point from preceeding Go closure. */
492
+ L(do_closure_STDCALL):
493
+
494
+ FFI_CLOSURE_PREP_CALL
495
+ FFI_CLOSURE_CALL_INNER(29)
496
+
497
+ movl %eax, %ecx
498
+ shrl $X86_RET_POP_SHIFT, %ecx /* isolate pop count */
499
+ leal closure_FS(%esp, %ecx), %ecx /* compute popped esp */
500
+ movl closure_FS(%esp), %edx /* move return address */
501
+ movl %edx, (%ecx)
502
+
503
+ /* From this point on, the value of %esp upon return is %ecx+4,
504
+ and we've copied the return address to %ecx to make return easy.
505
+ There's no point in representing this in the unwind info, as
506
+ there is always a window between the mov and the ret which
507
+ will be wrong from one point of view or another. */
508
+
509
+ FFI_CLOSURE_MASK_AND_JUMP(3, 30)
510
+
511
+ .balign 8
512
+ L(load_table3):
513
+ E(L(load_table3), X86_RET_FLOAT)
514
+ flds closure_CF(%esp)
515
+ movl %ecx, %esp
516
+ ret
517
+ E(L(load_table3), X86_RET_DOUBLE)
518
+ fldl closure_CF(%esp)
519
+ movl %ecx, %esp
520
+ ret
521
+ E(L(load_table3), X86_RET_LDOUBLE)
522
+ fldt closure_CF(%esp)
523
+ movl %ecx, %esp
524
+ ret
525
+ E(L(load_table3), X86_RET_SINT8)
526
+ movsbl %al, %eax
527
+ movl %ecx, %esp
528
+ ret
529
+ E(L(load_table3), X86_RET_SINT16)
530
+ movswl %ax, %eax
531
+ movl %ecx, %esp
532
+ ret
533
+ E(L(load_table3), X86_RET_UINT8)
534
+ movzbl %al, %eax
535
+ movl %ecx, %esp
536
+ ret
537
+ E(L(load_table3), X86_RET_UINT16)
538
+ movzwl %ax, %eax
539
+ movl %ecx, %esp
540
+ ret
541
+ E(L(load_table3), X86_RET_INT64)
542
+ movl closure_CF+4(%esp), %edx
543
+ movl %ecx, %esp
544
+ ret
545
+ E(L(load_table3), X86_RET_INT32)
546
+ movl %ecx, %esp
547
+ ret
548
+ E(L(load_table3), X86_RET_VOID)
549
+ movl %ecx, %esp
550
+ ret
551
+ E(L(load_table3), X86_RET_STRUCTPOP)
552
+ movl %ecx, %esp
553
+ ret
554
+ E(L(load_table3), X86_RET_STRUCTARG)
555
+ movl %ecx, %esp
556
+ ret
557
+ E(L(load_table3), X86_RET_STRUCT_1B)
558
+ movzbl %al, %eax
559
+ movl %ecx, %esp
560
+ ret
561
+ E(L(load_table3), X86_RET_STRUCT_2B)
562
+ movzwl %ax, %eax
563
+ movl %ecx, %esp
564
+ ret
565
+
566
+ /* Fill out the table so that bad values are predictable. */
567
+ E(L(load_table3), X86_RET_UNUSED14)
568
+ ud2
569
+ E(L(load_table3), X86_RET_UNUSED15)
570
+ ud2
571
+
572
+ L(UW31):
573
+ # cfi_endproc
574
+ ENDF(C(ffi_closure_STDCALL))
575
+
576
+ #if !FFI_NO_RAW_API
577
+
578
+ #define raw_closure_S_FS (16+16+12)
579
+
580
+ .balign 16
581
+ .globl C(ffi_closure_raw_SYSV)
582
+ FFI_HIDDEN(C(ffi_closure_raw_SYSV))
583
+ C(ffi_closure_raw_SYSV):
584
+ L(UW32):
585
+ # cfi_startproc
586
+ _CET_ENDBR
587
+ subl $raw_closure_S_FS, %esp
588
+ L(UW33):
589
+ # cfi_def_cfa_offset(raw_closure_S_FS + 4)
590
+ movl %ebx, raw_closure_S_FS-4(%esp)
591
+ L(UW34):
592
+ # cfi_rel_offset(%ebx, raw_closure_S_FS-4)
593
+
594
+ movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */
595
+ movl %edx, 12(%esp)
596
+ leal raw_closure_S_FS+4(%esp), %edx /* load raw_args */
597
+ movl %edx, 8(%esp)
598
+ leal 16(%esp), %edx /* load &res */
599
+ movl %edx, 4(%esp)
600
+ movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */
601
+ movl %ebx, (%esp)
602
+ call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */
603
+
604
+ movl 20(%ebx), %eax /* load cif->flags */
605
+ andl $X86_RET_TYPE_MASK, %eax
606
+ #ifdef __PIC__
607
+ call C(__x86.get_pc_thunk.bx)
608
+ L(pc4):
609
+ leal L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx
359
610
  #else
360
- .ascii "\0" /* CIE Augmentation */
611
+ leal L(load_table4)(,%eax, 8), %ecx
361
612
  #endif
362
- #elif defined HAVE_AS_STRING_PSEUDO_OP
613
+ movl raw_closure_S_FS-4(%esp), %ebx
614
+ L(UW35):
615
+ # cfi_restore(%ebx)
616
+ movl 16(%esp), %eax /* Optimistic load */
617
+ jmp *%ecx
618
+
619
+ .balign 8
620
+ L(load_table4):
621
+ E(L(load_table4), X86_RET_FLOAT)
622
+ flds 16(%esp)
623
+ jmp L(e4)
624
+ E(L(load_table4), X86_RET_DOUBLE)
625
+ fldl 16(%esp)
626
+ jmp L(e4)
627
+ E(L(load_table4), X86_RET_LDOUBLE)
628
+ fldt 16(%esp)
629
+ jmp L(e4)
630
+ E(L(load_table4), X86_RET_SINT8)
631
+ movsbl %al, %eax
632
+ jmp L(e4)
633
+ E(L(load_table4), X86_RET_SINT16)
634
+ movswl %ax, %eax
635
+ jmp L(e4)
636
+ E(L(load_table4), X86_RET_UINT8)
637
+ movzbl %al, %eax
638
+ jmp L(e4)
639
+ E(L(load_table4), X86_RET_UINT16)
640
+ movzwl %ax, %eax
641
+ jmp L(e4)
642
+ E(L(load_table4), X86_RET_INT64)
643
+ movl 16+4(%esp), %edx
644
+ jmp L(e4)
645
+ E(L(load_table4), X86_RET_INT32)
646
+ nop
647
+ /* fallthru */
648
+ E(L(load_table4), X86_RET_VOID)
649
+ L(e4):
650
+ addl $raw_closure_S_FS, %esp
651
+ L(UW36):
652
+ # cfi_adjust_cfa_offset(-raw_closure_S_FS)
653
+ ret
654
+ L(UW37):
655
+ # cfi_adjust_cfa_offset(raw_closure_S_FS)
656
+ E(L(load_table4), X86_RET_STRUCTPOP)
657
+ addl $raw_closure_S_FS, %esp
658
+ L(UW38):
659
+ # cfi_adjust_cfa_offset(-raw_closure_S_FS)
660
+ ret $4
661
+ L(UW39):
662
+ # cfi_adjust_cfa_offset(raw_closure_S_FS)
663
+ E(L(load_table4), X86_RET_STRUCTARG)
664
+ jmp L(e4)
665
+ E(L(load_table4), X86_RET_STRUCT_1B)
666
+ movzbl %al, %eax
667
+ jmp L(e4)
668
+ E(L(load_table4), X86_RET_STRUCT_2B)
669
+ movzwl %ax, %eax
670
+ jmp L(e4)
671
+
672
+ /* Fill out the table so that bad values are predictable. */
673
+ E(L(load_table4), X86_RET_UNUSED14)
674
+ ud2
675
+ E(L(load_table4), X86_RET_UNUSED15)
676
+ ud2
677
+
678
+ L(UW40):
679
+ # cfi_endproc
680
+ ENDF(C(ffi_closure_raw_SYSV))
681
+
682
+ #define raw_closure_T_FS (16+16+8)
683
+
684
+ .balign 16
685
+ .globl C(ffi_closure_raw_THISCALL)
686
+ FFI_HIDDEN(C(ffi_closure_raw_THISCALL))
687
+ C(ffi_closure_raw_THISCALL):
688
+ L(UW41):
689
+ # cfi_startproc
690
+ _CET_ENDBR
691
+ /* Rearrange the stack such that %ecx is the first argument.
692
+ This means moving the return address. */
693
+ popl %edx
694
+ L(UW42):
695
+ # cfi_def_cfa_offset(0)
696
+ # cfi_register(%eip, %edx)
697
+ pushl %ecx
698
+ L(UW43):
699
+ # cfi_adjust_cfa_offset(4)
700
+ pushl %edx
701
+ L(UW44):
702
+ # cfi_adjust_cfa_offset(4)
703
+ # cfi_rel_offset(%eip, 0)
704
+ subl $raw_closure_T_FS, %esp
705
+ L(UW45):
706
+ # cfi_adjust_cfa_offset(raw_closure_T_FS)
707
+ movl %ebx, raw_closure_T_FS-4(%esp)
708
+ L(UW46):
709
+ # cfi_rel_offset(%ebx, raw_closure_T_FS-4)
710
+
711
+ movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */
712
+ movl %edx, 12(%esp)
713
+ leal raw_closure_T_FS+4(%esp), %edx /* load raw_args */
714
+ movl %edx, 8(%esp)
715
+ leal 16(%esp), %edx /* load &res */
716
+ movl %edx, 4(%esp)
717
+ movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */
718
+ movl %ebx, (%esp)
719
+ call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */
720
+
721
+ movl 20(%ebx), %eax /* load cif->flags */
722
+ andl $X86_RET_TYPE_MASK, %eax
363
723
  #ifdef __PIC__
364
- .string "zR" /* CIE Augmentation */
724
+ call C(__x86.get_pc_thunk.bx)
725
+ L(pc5):
726
+ leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx
365
727
  #else
366
- .string "" /* CIE Augmentation */
728
+ leal L(load_table5)(,%eax, 8), %ecx
367
729
  #endif
730
+ movl raw_closure_T_FS-4(%esp), %ebx
731
+ L(UW47):
732
+ # cfi_restore(%ebx)
733
+ movl 16(%esp), %eax /* Optimistic load */
734
+ jmp *%ecx
735
+
736
+ .balign 8
737
+ L(load_table5):
738
+ E(L(load_table5), X86_RET_FLOAT)
739
+ flds 16(%esp)
740
+ jmp L(e5)
741
+ E(L(load_table5), X86_RET_DOUBLE)
742
+ fldl 16(%esp)
743
+ jmp L(e5)
744
+ E(L(load_table5), X86_RET_LDOUBLE)
745
+ fldt 16(%esp)
746
+ jmp L(e5)
747
+ E(L(load_table5), X86_RET_SINT8)
748
+ movsbl %al, %eax
749
+ jmp L(e5)
750
+ E(L(load_table5), X86_RET_SINT16)
751
+ movswl %ax, %eax
752
+ jmp L(e5)
753
+ E(L(load_table5), X86_RET_UINT8)
754
+ movzbl %al, %eax
755
+ jmp L(e5)
756
+ E(L(load_table5), X86_RET_UINT16)
757
+ movzwl %ax, %eax
758
+ jmp L(e5)
759
+ E(L(load_table5), X86_RET_INT64)
760
+ movl 16+4(%esp), %edx
761
+ jmp L(e5)
762
+ E(L(load_table5), X86_RET_INT32)
763
+ nop
764
+ /* fallthru */
765
+ E(L(load_table5), X86_RET_VOID)
766
+ L(e5):
767
+ addl $raw_closure_T_FS, %esp
768
+ L(UW48):
769
+ # cfi_adjust_cfa_offset(-raw_closure_T_FS)
770
+ /* Remove the extra %ecx argument we pushed. */
771
+ ret $4
772
+ L(UW49):
773
+ # cfi_adjust_cfa_offset(raw_closure_T_FS)
774
+ E(L(load_table5), X86_RET_STRUCTPOP)
775
+ addl $raw_closure_T_FS, %esp
776
+ L(UW50):
777
+ # cfi_adjust_cfa_offset(-raw_closure_T_FS)
778
+ ret $8
779
+ L(UW51):
780
+ # cfi_adjust_cfa_offset(raw_closure_T_FS)
781
+ E(L(load_table5), X86_RET_STRUCTARG)
782
+ jmp L(e5)
783
+ E(L(load_table5), X86_RET_STRUCT_1B)
784
+ movzbl %al, %eax
785
+ jmp L(e5)
786
+ E(L(load_table5), X86_RET_STRUCT_2B)
787
+ movzwl %ax, %eax
788
+ jmp L(e5)
789
+
790
+ /* Fill out the table so that bad values are predictable. */
791
+ E(L(load_table5), X86_RET_UNUSED14)
792
+ ud2
793
+ E(L(load_table5), X86_RET_UNUSED15)
794
+ ud2
795
+
796
+ L(UW52):
797
+ # cfi_endproc
798
+ ENDF(C(ffi_closure_raw_THISCALL))
799
+
800
+ #endif /* !FFI_NO_RAW_API */
801
+
802
+ #ifdef X86_DARWIN
803
+ # define COMDAT(X) \
804
+ .section __TEXT,__text,coalesced,pure_instructions; \
805
+ .weak_definition X; \
806
+ FFI_HIDDEN(X)
807
+ #elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
808
+ # define COMDAT(X) \
809
+ .section .text.X,"axG",@progbits,X,comdat; \
810
+ .globl X; \
811
+ FFI_HIDDEN(X)
368
812
  #else
369
- #error missing .ascii/.string
813
+ # define COMDAT(X)
370
814
  #endif
371
- .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
372
- .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
373
- .byte 0x8 /* CIE RA Column */
374
- #ifdef __PIC__
375
- .byte 0x1 /* .uleb128 0x1; Augmentation size */
376
- .byte FDE_ENCODING
815
+
816
+ #if defined(__PIC__)
817
+ COMDAT(C(__x86.get_pc_thunk.bx))
818
+ C(__x86.get_pc_thunk.bx):
819
+ movl (%esp), %ebx
820
+ ret
821
+ ENDF(C(__x86.get_pc_thunk.bx))
822
+ # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
823
+ COMDAT(C(__x86.get_pc_thunk.dx))
824
+ C(__x86.get_pc_thunk.dx):
825
+ movl (%esp), %edx
826
+ ret
827
+ ENDF(C(__x86.get_pc_thunk.dx))
828
+ #endif /* DARWIN || HIDDEN */
829
+ #endif /* __PIC__ */
830
+
831
+ /* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */
832
+
833
+ #ifdef __APPLE__
834
+ .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
835
+ EHFrame0:
836
+ #elif defined(X86_WIN32)
837
+ .section .eh_frame,"r"
838
+ #elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
839
+ .section .eh_frame,EH_FRAME_FLAGS,@unwind
840
+ #else
841
+ .section .eh_frame,EH_FRAME_FLAGS,@progbits
377
842
  #endif
378
- .byte 0xc /* DW_CFA_def_cfa */
379
- .byte 0x4 /* .uleb128 0x4 */
380
- .byte 0x4 /* .uleb128 0x4 */
381
- .byte 0x88 /* DW_CFA_offset, column 0x8 */
382
- .byte 0x1 /* .uleb128 0x1 */
383
- .align 4
384
- .LECIE1:
385
- .LSFDE1:
386
- .long .LEFDE1-.LASFDE1 /* FDE Length */
387
- .LASFDE1:
388
- .long .LASFDE1-.Lframe1 /* FDE CIE offset */
389
- .long FDE_ENCODE(.LFB1) /* FDE initial location */
390
- .long .LFE1-.LFB1 /* FDE address range */
391
- #ifdef __PIC__
392
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
843
+
844
+ #ifdef HAVE_AS_X86_PCREL
845
+ # define PCREL(X) X - .
846
+ #else
847
+ # define PCREL(X) X@rel
393
848
  #endif
394
- .byte 0x4 /* DW_CFA_advance_loc4 */
395
- .long .LCFI0-.LFB1
396
- .byte 0xe /* DW_CFA_def_cfa_offset */
397
- .byte 0x8 /* .uleb128 0x8 */
398
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
399
- .byte 0x2 /* .uleb128 0x2 */
400
- .byte 0x4 /* DW_CFA_advance_loc4 */
401
- .long .LCFI1-.LCFI0
402
- .byte 0xd /* DW_CFA_def_cfa_register */
403
- .byte 0x5 /* .uleb128 0x5 */
404
- .align 4
405
- .LEFDE1:
406
- .LSFDE2:
407
- .long .LEFDE2-.LASFDE2 /* FDE Length */
408
- .LASFDE2:
409
- .long .LASFDE2-.Lframe1 /* FDE CIE offset */
410
- .long FDE_ENCODE(.LFB2) /* FDE initial location */
411
- .long .LFE2-.LFB2 /* FDE address range */
412
- #ifdef __PIC__
413
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
849
+
850
+ /* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */
851
+ #define ADV(N, P) .byte 2, L(N)-L(P)
852
+
853
+ .balign 4
854
+ L(CIE):
855
+ .set L(set0),L(ECIE)-L(SCIE)
856
+ .long L(set0) /* CIE Length */
857
+ L(SCIE):
858
+ .long 0 /* CIE Identifier Tag */
859
+ .byte 1 /* CIE Version */
860
+ .ascii "zR\0" /* CIE Augmentation */
861
+ .byte 1 /* CIE Code Alignment Factor */
862
+ .byte 0x7c /* CIE Data Alignment Factor */
863
+ .byte 0x8 /* CIE RA Column */
864
+ .byte 1 /* Augmentation size */
865
+ .byte 0x1b /* FDE Encoding (pcrel sdata4) */
866
+ .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp offset 4 */
867
+ .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */
868
+ .balign 4
869
+ L(ECIE):
870
+
871
+ .set L(set1),L(EFDE1)-L(SFDE1)
872
+ .long L(set1) /* FDE Length */
873
+ L(SFDE1):
874
+ .long L(SFDE1)-L(CIE) /* FDE CIE offset */
875
+ .long PCREL(L(UW0)) /* Initial location */
876
+ .long L(UW5)-L(UW0) /* Address range */
877
+ .byte 0 /* Augmentation size */
878
+ ADV(UW1, UW0)
879
+ .byte 0xc, 5, 8 /* DW_CFA_def_cfa, %ebp 8 */
880
+ .byte 0x80+5, 2 /* DW_CFA_offset, %ebp 2*-4 */
881
+ ADV(UW2, UW1)
882
+ .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */
883
+ ADV(UW3, UW2)
884
+ .byte 0xa /* DW_CFA_remember_state */
885
+ .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp 4 */
886
+ .byte 0xc0+3 /* DW_CFA_restore, %ebx */
887
+ .byte 0xc0+5 /* DW_CFA_restore, %ebp */
888
+ ADV(UW4, UW3)
889
+ .byte 0xb /* DW_CFA_restore_state */
890
+ .balign 4
891
+ L(EFDE1):
892
+
893
+ .set L(set2),L(EFDE2)-L(SFDE2)
894
+ .long L(set2) /* FDE Length */
895
+ L(SFDE2):
896
+ .long L(SFDE2)-L(CIE) /* FDE CIE offset */
897
+ .long PCREL(L(UW6)) /* Initial location */
898
+ .long L(UW8)-L(UW6) /* Address range */
899
+ .byte 0 /* Augmentation size */
900
+ ADV(UW7, UW6)
901
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
902
+ .balign 4
903
+ L(EFDE2):
904
+
905
+ .set L(set3),L(EFDE3)-L(SFDE3)
906
+ .long L(set3) /* FDE Length */
907
+ L(SFDE3):
908
+ .long L(SFDE3)-L(CIE) /* FDE CIE offset */
909
+ .long PCREL(L(UW9)) /* Initial location */
910
+ .long L(UW11)-L(UW9) /* Address range */
911
+ .byte 0 /* Augmentation size */
912
+ ADV(UW10, UW9)
913
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
914
+ .balign 4
915
+ L(EFDE3):
916
+
917
+ .set L(set4),L(EFDE4)-L(SFDE4)
918
+ .long L(set4) /* FDE Length */
919
+ L(SFDE4):
920
+ .long L(SFDE4)-L(CIE) /* FDE CIE offset */
921
+ .long PCREL(L(UW12)) /* Initial location */
922
+ .long L(UW20)-L(UW12) /* Address range */
923
+ .byte 0 /* Augmentation size */
924
+ ADV(UW13, UW12)
925
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
926
+ #ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
927
+ ADV(UW14, UW13)
928
+ .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */
929
+ ADV(UW15, UW14)
930
+ .byte 0xc0+3 /* DW_CFA_restore %ebx */
931
+ ADV(UW16, UW15)
932
+ #else
933
+ ADV(UW16, UW13)
414
934
  #endif
415
- .byte 0x4 /* DW_CFA_advance_loc4 */
416
- .long .LCFI2-.LFB2
417
- .byte 0xe /* DW_CFA_def_cfa_offset */
418
- .byte 0x8 /* .uleb128 0x8 */
419
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
420
- .byte 0x2 /* .uleb128 0x2 */
421
- .byte 0x4 /* DW_CFA_advance_loc4 */
422
- .long .LCFI3-.LCFI2
423
- .byte 0xd /* DW_CFA_def_cfa_register */
424
- .byte 0x5 /* .uleb128 0x5 */
425
- #if !defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE && defined __PIC__
426
- .byte 0x4 /* DW_CFA_advance_loc4 */
427
- .long .LCFI7-.LCFI3
428
- .byte 0x83 /* DW_CFA_offset, column 0x3 */
429
- .byte 0xa /* .uleb128 0xa */
935
+ .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
936
+ ADV(UW17, UW16)
937
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
938
+ ADV(UW18, UW17)
939
+ .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
940
+ ADV(UW19, UW18)
941
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
942
+ .balign 4
943
+ L(EFDE4):
944
+
945
+ .set L(set5),L(EFDE5)-L(SFDE5)
946
+ .long L(set5) /* FDE Length */
947
+ L(SFDE5):
948
+ .long L(SFDE5)-L(CIE) /* FDE CIE offset */
949
+ .long PCREL(L(UW21)) /* Initial location */
950
+ .long L(UW23)-L(UW21) /* Address range */
951
+ .byte 0 /* Augmentation size */
952
+ ADV(UW22, UW21)
953
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
954
+ .balign 4
955
+ L(EFDE5):
956
+
957
+ .set L(set6),L(EFDE6)-L(SFDE6)
958
+ .long L(set6) /* FDE Length */
959
+ L(SFDE6):
960
+ .long L(SFDE6)-L(CIE) /* FDE CIE offset */
961
+ .long PCREL(L(UW24)) /* Initial location */
962
+ .long L(UW26)-L(UW24) /* Address range */
963
+ .byte 0 /* Augmentation size */
964
+ .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
965
+ .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */
966
+ ADV(UW25, UW24)
967
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
968
+ .balign 4
969
+ L(EFDE6):
970
+
971
+ .set L(set7),L(EFDE7)-L(SFDE7)
972
+ .long L(set7) /* FDE Length */
973
+ L(SFDE7):
974
+ .long L(SFDE7)-L(CIE) /* FDE CIE offset */
975
+ .long PCREL(L(UW27)) /* Initial location */
976
+ .long L(UW31)-L(UW27) /* Address range */
977
+ .byte 0 /* Augmentation size */
978
+ ADV(UW28, UW27)
979
+ .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
980
+ #ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
981
+ ADV(UW29, UW28)
982
+ .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */
983
+ ADV(UW30, UW29)
984
+ .byte 0xc0+3 /* DW_CFA_restore %ebx */
430
985
  #endif
431
- .align 4
432
- .LEFDE2:
986
+ .balign 4
987
+ L(EFDE7):
433
988
 
434
989
  #if !FFI_NO_RAW_API
990
+ .set L(set8),L(EFDE8)-L(SFDE8)
991
+ .long L(set8) /* FDE Length */
992
+ L(SFDE8):
993
+ .long L(SFDE8)-L(CIE) /* FDE CIE offset */
994
+ .long PCREL(L(UW32)) /* Initial location */
995
+ .long L(UW40)-L(UW32) /* Address range */
996
+ .byte 0 /* Augmentation size */
997
+ ADV(UW33, UW32)
998
+ .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
999
+ ADV(UW34, UW33)
1000
+ .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */
1001
+ ADV(UW35, UW34)
1002
+ .byte 0xc0+3 /* DW_CFA_restore %ebx */
1003
+ ADV(UW36, UW35)
1004
+ .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
1005
+ ADV(UW37, UW36)
1006
+ .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
1007
+ ADV(UW38, UW37)
1008
+ .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
1009
+ ADV(UW39, UW38)
1010
+ .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
1011
+ .balign 4
1012
+ L(EFDE8):
435
1013
 
436
- .LSFDE3:
437
- .long .LEFDE3-.LASFDE3 /* FDE Length */
438
- .LASFDE3:
439
- .long .LASFDE3-.Lframe1 /* FDE CIE offset */
440
- .long FDE_ENCODE(.LFB3) /* FDE initial location */
441
- .long .LFE3-.LFB3 /* FDE address range */
442
- #ifdef __PIC__
443
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
444
- #endif
445
- .byte 0x4 /* DW_CFA_advance_loc4 */
446
- .long .LCFI4-.LFB3
447
- .byte 0xe /* DW_CFA_def_cfa_offset */
448
- .byte 0x8 /* .uleb128 0x8 */
449
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
450
- .byte 0x2 /* .uleb128 0x2 */
451
- .byte 0x4 /* DW_CFA_advance_loc4 */
452
- .long .LCFI5-.LCFI4
453
- .byte 0xd /* DW_CFA_def_cfa_register */
454
- .byte 0x5 /* .uleb128 0x5 */
455
- .byte 0x4 /* DW_CFA_advance_loc4 */
456
- .long .LCFI6-.LCFI5
457
- .byte 0x86 /* DW_CFA_offset, column 0x6 */
458
- .byte 0x3 /* .uleb128 0x3 */
459
- .align 4
460
- .LEFDE3:
1014
+ .set L(set9),L(EFDE9)-L(SFDE9)
1015
+ .long L(set9) /* FDE Length */
1016
+ L(SFDE9):
1017
+ .long L(SFDE9)-L(CIE) /* FDE CIE offset */
1018
+ .long PCREL(L(UW41)) /* Initial location */
1019
+ .long L(UW52)-L(UW41) /* Address range */
1020
+ .byte 0 /* Augmentation size */
1021
+ ADV(UW42, UW41)
1022
+ .byte 0xe, 0 /* DW_CFA_def_cfa_offset */
1023
+ .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */
1024
+ ADV(UW43, UW42)
1025
+ .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
1026
+ ADV(UW44, UW43)
1027
+ .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1028
+ .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */
1029
+ ADV(UW45, UW44)
1030
+ .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1031
+ ADV(UW46, UW45)
1032
+ .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */
1033
+ ADV(UW47, UW46)
1034
+ .byte 0xc0+3 /* DW_CFA_restore %ebx */
1035
+ ADV(UW48, UW47)
1036
+ .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1037
+ ADV(UW49, UW48)
1038
+ .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1039
+ ADV(UW50, UW49)
1040
+ .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1041
+ ADV(UW51, UW50)
1042
+ .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1043
+ .balign 4
1044
+ L(EFDE9):
1045
+ #endif /* !FFI_NO_RAW_API */
461
1046
 
1047
+ #ifdef _WIN32
1048
+ .def @feat.00;
1049
+ .scl 3;
1050
+ .type 0;
1051
+ .endef
1052
+ .globl @feat.00
1053
+ @feat.00 = 1
462
1054
  #endif
463
1055
 
464
- #endif /* ifndef __x86_64__ */
1056
+ #ifdef __APPLE__
1057
+ .subsections_via_symbols
1058
+ .section __LD,__compact_unwind,regular,debug
1059
+
1060
+ /* compact unwind for ffi_call_i386 */
1061
+ .long C(ffi_call_i386)
1062
+ .set L1,L(UW5)-L(UW0)
1063
+ .long L1
1064
+ .long 0x04000000 /* use dwarf unwind info */
1065
+ .long 0
1066
+ .long 0
1067
+
1068
+ /* compact unwind for ffi_go_closure_EAX */
1069
+ .long C(ffi_go_closure_EAX)
1070
+ .set L2,L(UW8)-L(UW6)
1071
+ .long L2
1072
+ .long 0x04000000 /* use dwarf unwind info */
1073
+ .long 0
1074
+ .long 0
1075
+
1076
+ /* compact unwind for ffi_go_closure_ECX */
1077
+ .long C(ffi_go_closure_ECX)
1078
+ .set L3,L(UW11)-L(UW9)
1079
+ .long L3
1080
+ .long 0x04000000 /* use dwarf unwind info */
1081
+ .long 0
1082
+ .long 0
1083
+
1084
+ /* compact unwind for ffi_closure_i386 */
1085
+ .long C(ffi_closure_i386)
1086
+ .set L4,L(UW20)-L(UW12)
1087
+ .long L4
1088
+ .long 0x04000000 /* use dwarf unwind info */
1089
+ .long 0
1090
+ .long 0
1091
+
1092
+ /* compact unwind for ffi_go_closure_STDCALL */
1093
+ .long C(ffi_go_closure_STDCALL)
1094
+ .set L5,L(UW23)-L(UW21)
1095
+ .long L5
1096
+ .long 0x04000000 /* use dwarf unwind info */
1097
+ .long 0
1098
+ .long 0
1099
+
1100
+ /* compact unwind for ffi_closure_REGISTER */
1101
+ .long C(ffi_closure_REGISTER)
1102
+ .set L6,L(UW26)-L(UW24)
1103
+ .long L6
1104
+ .long 0x04000000 /* use dwarf unwind info */
1105
+ .long 0
1106
+ .long 0
1107
+
1108
+ /* compact unwind for ffi_closure_STDCALL */
1109
+ .long C(ffi_closure_STDCALL)
1110
+ .set L7,L(UW31)-L(UW27)
1111
+ .long L7
1112
+ .long 0x04000000 /* use dwarf unwind info */
1113
+ .long 0
1114
+ .long 0
1115
+
1116
+ /* compact unwind for ffi_closure_raw_SYSV */
1117
+ .long C(ffi_closure_raw_SYSV)
1118
+ .set L8,L(UW40)-L(UW32)
1119
+ .long L8
1120
+ .long 0x04000000 /* use dwarf unwind info */
1121
+ .long 0
1122
+ .long 0
1123
+
1124
+ /* compact unwind for ffi_closure_raw_THISCALL */
1125
+ .long C(ffi_closure_raw_THISCALL)
1126
+ .set L9,L(UW52)-L(UW41)
1127
+ .long L9
1128
+ .long 0x04000000 /* use dwarf unwind info */
1129
+ .long 0
1130
+ .long 0
1131
+ #endif /* __APPLE__ */
1132
+
1133
+ #endif /* ifndef _MSC_VER */
1134
+ #endif /* ifdef __i386__ */
465
1135
 
466
1136
  #if defined __ELF__ && defined __linux__
467
1137
  .section .note.GNU-stack,"",@progbits