summaryrefslogtreecommitdiffhomepage
path: root/patches/php-8.1.10.local.patch
blob: e9f551a10328f0b9735b6d2c9fc010401a08c298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
diff -Nru php-8.1.0.orig/Zend/asm/jump_x86_64_ms_pe_gas.S php-8.1.0/Zend/asm/jump_x86_64_ms_pe_gas.S
--- php-8.1.0.orig/Zend/asm/jump_x86_64_ms_pe_gas.S	1970-01-01 01:00:00.000000000 +0100
+++ php-8.1.0/Zend/asm/jump_x86_64_ms_pe_gas.S	2021-11-28 11:43:11.689492139 +0100
@@ -0,0 +1,213 @@
+/*
+            Copyright Oliver Kowalke 2009.
+            Copyright Thomas Sailer 2013.
+   Distributed under the Boost Software License, Version 1.0.
+      (See accompanying file LICENSE_1_0.txt or copy at
+            http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/*************************************************************************************
+* ---------------------------------------------------------------------------------- *
+* |     0   |     1   |     2    |     3   |     4   |     5   |     6   |     7   | *
+* ---------------------------------------------------------------------------------- *
+* |    0x0  |    0x4  |    0x8   |    0xc  |   0x10  |   0x14  |   0x18  |   0x1c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |     8   |    9    |    10    |    11   |    12   |    13   |    14   |    15   | *
+* ---------------------------------------------------------------------------------- *
+* |   0x20  |  0x24   |   0x28   |   0x2c  |   0x30  |   0x34  |   0x38  |   0x3c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    16   |    17   |    18   |    19    |    20   |    21   |    22   |    23   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xe40  |   0x44 |   0x48  |   0x4c   |   0x50  |   0x54  |   0x58  |   0x5c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    24   |   25    |    26    |   27    |    28   |    29   |    30   |    31   | *
+* ---------------------------------------------------------------------------------- *
+* |   0x60  |   0x64  |   0x68   |   0x6c  |   0x70  |   0x74  |   0x78  |   0x7c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    32   |   32    |    33    |   34    |    35   |    36   |    37   |    38   | *
+* ---------------------------------------------------------------------------------- *
+* |   0x80  |   0x84  |   0x88   |   0x8c  |   0x90  |   0x94  |   0x98  |   0x9c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    39   |   40    |    41    |   42    |    43   |    44   |    45   |    46   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xa0  |   0xa4  |   0xa8   |   0xac  |   0xb0  |   0xb4  |   0xb8  |   0xbc  | *
+* ---------------------------------------------------------------------------------- *
+* | fc_mxcsr|fc_x87_cw|     <alignment>    |       fbr_strg    |      fc_dealloc   | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    47   |   48    |    49    |   50    |    51   |    52   |    53   |    54   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xc0  |   0xc4  |   0xc8   |   0xcc  |   0xd0  |   0xd4  |   0xd8  |   0xdc  | *
+* ---------------------------------------------------------------------------------- *
+* |        limit      |         base       |         R12       |         R13       | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    55   |   56    |    57    |   58    |    59   |    60   |    61   |    62   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xe0  |   0xe4  |   0xe8   |   0xec  |   0xf0  |   0xf4  |   0xf8  |   0xfc  | *
+* ---------------------------------------------------------------------------------- *
+* |        R14        |         R15        |         RDI       |        RSI        | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    63   |   64    |    65    |   66    |    67   |    68   |    69   |    70   | *
+* ---------------------------------------------------------------------------------- *
+* |  0x100  |  0x104  |  0x108   |  0x10c  |  0x110  |  0x114  |  0x118  |  0x11c  | *
+* ---------------------------------------------------------------------------------- *
+* |        RBX        |         RBP        |       hidden      |        RIP        | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    71   |   72    |    73    |   74    |    75   |    76   |    77   |    78   | *
+* ---------------------------------------------------------------------------------- *
+* |  0x120  |  0x124  |  0x128   |  0x12c  |  0x130  |  0x134  |  0x138  |  0x13c  | *
+* ---------------------------------------------------------------------------------- *
+* |                                   parameter area                               | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    79   |   80    |    81    |   82    |    83   |    84   |    85   |    86   | *
+* ---------------------------------------------------------------------------------- *
+* |  0x140  |  0x144  |  0x148   |  0x14c  |  0x150  |  0x154  |  0x158  |  0x15c  | *
+* ---------------------------------------------------------------------------------- *
+* |       FCTX        |        DATA        |                                       | *
+* ---------------------------------------------------------------------------------- *
+**************************************************************************************/
+
+.file	"jump_x86_64_ms_pe_gas.asm"
+.text
+.p2align 4,,15
+.def	jump_fcontext;	.scl	2;	.type	32;	.endef
+.seh_proc	jump_fcontext
+jump_fcontext:
+.seh_endprologue
+
+    leaq  -0x118(%rsp), %rsp /* prepare stack */
+
+#if !defined(BOOST_USE_TSX)
+    /* save XMM storage */
+    movaps  %xmm6, 0x0(%rsp)
+    movaps  %xmm7, 0x10(%rsp)
+    movaps  %xmm8, 0x20(%rsp)
+    movaps  %xmm9, 0x30(%rsp)
+    movaps  %xmm10, 0x40(%rsp)
+    movaps  %xmm11, 0x50(%rsp)
+    movaps  %xmm12, 0x60(%rsp)
+    movaps  %xmm13, 0x70(%rsp)
+    movaps  %xmm14, 0x80(%rsp)
+    movaps  %xmm15, 0x90(%rsp)
+    stmxcsr  0xa0(%rsp)  /* save MMX control- and status-word */
+    fnstcw   0xa4(%rsp)  /* save x87 control-word */
+#endif
+
+    /* load NT_TIB */
+    movq  %gs:(0x30), %r10
+    /* save fiber local storage */
+    movq  0x20(%r10), %rax
+    movq  %rax, 0xb0(%rsp)
+    /* save current deallocation stack */
+    movq  0x1478(%r10), %rax
+    movq  %rax, 0xb8(%rsp)
+    /* save current stack limit */
+    movq  0x10(%r10), %rax
+    movq  %rax, 0xc0(%rsp)
+    /* save current stack base */
+    movq  0x08(%r10), %rax
+    movq  %rax, 0xc8(%rsp)
+
+    movq  %r12, 0xd0(%rsp)  /* save R12 */
+    movq  %r13, 0xd8(%rsp)  /* save R13 */
+    movq  %r14, 0xe0(%rsp)  /* save R14 */
+    movq  %r15, 0xe8(%rsp)  /* save R15 */
+    movq  %rdi, 0xf0(%rsp)  /* save RDI */
+    movq  %rsi, 0xf8(%rsp)  /* save RSI */
+    movq  %rbx, 0x100(%rsp)  /* save RBX */
+    movq  %rbp, 0x108(%rsp)  /* save RBP */
+
+    movq  %rcx, 0x110(%rsp)  /* save hidden address of transport_t */
+
+    /* preserve RSP (pointing to context-data) in R9 */
+    movq  %rsp, %r9
+
+    /* restore RSP (pointing to context-data) from RDX */
+    movq  %rdx, %rsp
+
+#if !defined(BOOST_USE_TSX)
+    /* restore XMM storage */
+    movaps  0x0(%rsp), %xmm6
+    movaps  0x10(%rsp), %xmm7
+    movaps  0x20(%rsp), %xmm8
+    movaps  0x30(%rsp), %xmm9
+    movaps  0x40(%rsp), %xmm10
+    movaps  0x50(%rsp), %xmm11
+    movaps  0x60(%rsp), %xmm12
+    movaps  0x70(%rsp), %xmm13
+    movaps  0x80(%rsp), %xmm14
+    movaps  0x90(%rsp), %xmm15
+ 	ldmxcsr 0xa0(%rsp) /* restore MMX control- and status-word */
+ 	fldcw   0xa4(%rsp) /* restore x87 control-word */
+#endif
+
+    /* load NT_TIB */
+    movq  %gs:(0x30), %r10
+    /* restore fiber local storage */
+    movq  0xb0(%rsp), %rax
+    movq  %rax, 0x20(%r10)
+    /* restore current deallocation stack */
+    movq  0xb8(%rsp), %rax
+    movq  %rax, 0x1478(%r10)
+    /* restore current stack limit */
+    movq  0xc0(%rsp), %rax
+    movq  %rax, 0x10(%r10)
+    /* restore current stack base */
+    movq  0xc8(%rsp), %rax
+    movq  %rax, 0x08(%r10)
+
+    movq  0xd0(%rsp),  %r12  /* restore R12 */
+    movq  0xd8(%rsp),  %r13  /* restore R13 */
+    movq  0xe0(%rsp),  %r14  /* restore R14 */
+    movq  0xe8(%rsp),  %r15  /* restore R15 */
+    movq  0xf0(%rsp),  %rdi  /* restore RDI */
+    movq  0xf8(%rsp),  %rsi  /* restore RSI */
+    movq  0x100(%rsp), %rbx  /* restore RBX */
+    movq  0x108(%rsp), %rbp  /* restore RBP */
+
+    movq  0x110(%rsp), %rax  /* restore hidden address of transport_t */
+
+    leaq  0x118(%rsp), %rsp /* prepare stack */
+
+    /* restore return-address */
+    popq  %r10
+
+    /* transport_t returned in RAX */
+    /* return parent fcontext_t */
+    movq  %r9, 0x0(%rax)
+    /* return data */
+    movq  %r8, 0x8(%rax)
+
+    /* transport_t as 1.arg of context-function */
+    movq  %rax, %rcx
+
+    /* indirect jump to context */
+    jmp  *%r10
+.seh_endproc
+
+#ifdef __midipix__
+        .section .got$jump_fcontext,"r"
+        .global __imp_jump_fcontext
+__imp_jump_fcontext:
+        .quad   jump_fcontext
+        .linkonce discard
+#endif
diff -Nru php-8.1.0.orig/Zend/asm/make_x86_64_ms_pe_gas.S php-8.1.0/Zend/asm/make_x86_64_ms_pe_gas.S
--- php-8.1.0.orig/Zend/asm/make_x86_64_ms_pe_gas.S	1970-01-01 01:00:00.000000000 +0100
+++ php-8.1.0/Zend/asm/make_x86_64_ms_pe_gas.S	2021-11-28 11:44:29.385178672 +0100
@@ -0,0 +1,178 @@
+/*
+            Copyright Oliver Kowalke 2009.
+            Copyright Thomas Sailer 2013.
+   Distributed under the Boost Software License, Version 1.0.
+      (See accompanying file LICENSE_1_0.txt or copy at
+            http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/*************************************************************************************
+* ---------------------------------------------------------------------------------- *
+* |     0   |     1   |     2    |     3   |     4   |     5   |     6   |     7   | *
+* ---------------------------------------------------------------------------------- *
+* |    0x0  |    0x4  |    0x8   |    0xc  |   0x10  |   0x14  |   0x18  |   0x1c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |     8   |    9    |    10    |    11   |    12   |    13   |    14   |    15   | *
+* ---------------------------------------------------------------------------------- *
+* |   0x20  |  0x24   |   0x28   |   0x2c  |   0x30  |   0x34  |   0x38  |   0x3c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    16   |    17   |    18   |    19    |    20   |    21   |    22   |    23   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xe40  |   0x44 |   0x48  |   0x4c   |   0x50  |   0x54  |   0x58  |   0x5c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    24   |   25    |    26    |   27    |    28   |    29   |    30   |    31   | *
+* ---------------------------------------------------------------------------------- *
+* |   0x60  |   0x64  |   0x68   |   0x6c  |   0x70  |   0x74  |   0x78  |   0x7c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    32   |   32    |    33    |   34    |    35   |    36   |    37   |    38   | *
+* ---------------------------------------------------------------------------------- *
+* |   0x80  |   0x84  |   0x88   |   0x8c  |   0x90  |   0x94  |   0x98  |   0x9c  | *
+* ---------------------------------------------------------------------------------- *
+* |                          SEE registers (XMM6-XMM15)                            | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    39   |   40    |    41    |   42    |    43   |    44   |    45   |    46   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xa0  |   0xa4  |   0xa8   |   0xac  |   0xb0  |   0xb4  |   0xb8  |   0xbc  | *
+* ---------------------------------------------------------------------------------- *
+* | fc_mxcsr|fc_x87_cw|     <alignment>    |       fbr_strg    |      fc_dealloc   | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    47   |   48    |    49    |   50    |    51   |    52   |    53   |    54   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xc0  |   0xc4  |   0xc8   |   0xcc  |   0xd0  |   0xd4  |   0xd8  |   0xdc  | *
+* ---------------------------------------------------------------------------------- *
+* |        limit      |         base       |         R12       |         R13       | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    55   |   56    |    57    |   58    |    59   |    60   |    61   |    62   | *
+* ---------------------------------------------------------------------------------- *
+* |   0xe0  |   0xe4  |   0xe8   |   0xec  |   0xf0  |   0xf4  |   0xf8  |   0xfc  | *
+* ---------------------------------------------------------------------------------- *
+* |        R14        |         R15        |         RDI       |        RSI        | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    63   |   64    |    65    |   66    |    67   |    68   |    69   |    70   | *
+* ---------------------------------------------------------------------------------- *
+* |  0x100  |  0x104  |  0x108   |  0x10c  |  0x110  |  0x114  |  0x118  |  0x11c  | *
+* ---------------------------------------------------------------------------------- *
+* |        RBX        |         RBP        |       hidden      |        RIP        | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    71   |   72    |    73    |   74    |    75   |    76   |    77   |    78   | *
+* ---------------------------------------------------------------------------------- *
+* |  0x120  |  0x124  |  0x128   |  0x12c  |  0x130  |  0x134  |  0x138  |  0x13c  | *
+* ---------------------------------------------------------------------------------- *
+* |                                   parameter area                               | *
+* ---------------------------------------------------------------------------------- *
+* ---------------------------------------------------------------------------------- *
+* |    79   |   80    |    81    |   82    |    83   |    84   |    85   |    86   | *
+* ---------------------------------------------------------------------------------- *
+* |  0x140  |  0x144  |  0x148   |  0x14c  |  0x150  |  0x154  |  0x158  |  0x15c  | *
+* ---------------------------------------------------------------------------------- *
+* |       FCTX        |        DATA        |                                       | *
+* ---------------------------------------------------------------------------------- *
+**************************************************************************************/
+
+.file	"make_x86_64_ms_pe_gas.asm"
+.text
+.p2align 4,,15
+.def	make_fcontext;	.scl	2;	.type	32;	.endef
+.seh_proc	make_fcontext
+make_fcontext:
+.seh_endprologue
+
+    /* first arg of make_fcontext() == top of context-stack */
+    movq  %rcx, %rax
+
+    /* shift address in RAX to lower 16 byte boundary */
+    /* == pointer to fcontext_t and address of context stack */
+    andq  $-16, %rax
+
+    /* reserve space for context-data on context-stack */
+    /* on context-function entry: (RSP -0x8) % 16 == 0 */
+    leaq  -0x150(%rax), %rax
+
+    /* third arg of make_fcontext() == address of context-function */
+    movq  %r8, 0x100(%rax)
+
+    /* first arg of make_fcontext() == top of context-stack */
+    /* save top address of context stack as 'base' */
+    movq  %rcx, 0xc8(%rax)
+    /* second arg of make_fcontext() == size of context-stack */
+    /* negate stack size for LEA instruction (== substraction) */
+    negq  %rdx
+    /* compute bottom address of context stack (limit) */
+    leaq  (%rcx,%rdx), %rcx
+    /* save bottom address of context stack as 'limit' */
+    movq  %rcx, 0xc0(%rax)
+    /* save address of context stack limit as 'dealloction stack' */
+    movq  %rcx, 0xb8(%rax)
+	/* set fiber-storage to zero */
+    xorq  %rcx, %rcx
+    movq  %rcx, 0xb0(%rax)
+
+	/* save MMX control- and status-word */
+    stmxcsr  0xa0(%rax)
+    /* save x87 control-word */
+    fnstcw   0xa4(%rax)
+
+    /* compute address of transport_t */
+    leaq  0x140(%rax), %rcx
+    /* store address of transport_t in hidden field */
+    movq %rcx, 0x110(%rax)
+
+    /* compute abs address of label trampoline */
+    leaq  trampoline(%rip), %rcx
+    /* save address of finish as return-address for context-function */
+    /* will be entered after jump_fcontext() first time */
+    movq  %rcx, 0x118(%rax)
+
+    /* compute abs address of label finish */
+    leaq  finish(%rip), %rcx
+    /* save address of finish as return-address for context-function */
+    /* will be entered after context-function returns */
+    movq  %rcx, 0x108(%rax)
+
+    ret /* return pointer to context-data */
+
+trampoline:
+    /* store return address on stack */
+    /* fix stack alignment */ 
+    pushq %rbp
+    /* jump to context-function */
+    jmp *%rbx
+
+finish:
+    /* 32byte shadow-space for _exit() */
+    andq  $-32, %rsp
+    /* 32byte shadow-space for _exit() are */
+    /* already reserved by make_fcontext() */
+    /* exit code is zero */
+    xorq  %rcx, %rcx
+    /* exit application */
+    call  _exit
+    hlt
+.seh_endproc
+
+.def	_exit;	.scl	2;	.type	32;	.endef  /* standard C library function */
+
+#ifdef __midipix__
+        .section .got$make_fcontext,"r"
+        .global __imp_make_fcontext
+__imp_make_fcontext:
+        .quad   make_fcontext
+        .linkonce discard
+#endif