1
Index: libsdl1.2-1.2.10/src/hermes/common.inc
2
===================================================================
3
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4
+++ libsdl1.2-1.2.10/src/hermes/common.inc 2006-05-31 15:22:16.000000000 +0200
7
+; PIC support for HERMES
8
+; Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
9
+; This source code is licensed under the GNU LGPL
11
+; Please refer to the file COPYING.LIB contained in the distribution for
12
+; licensing conditions
15
+; These macros are totally harmless when PIC is not defined but can ruin
16
+; everything if misused in PIC mode. On x86, shared objects cannot directly
17
+; access global variables by address, they need to go through the GOT (global
18
+; offset table). Most OSes do not care about it and let you load non-shared
19
+; .so objects (Linux, Win32...). However, OS X requires PIC code in its
22
+; - GOT_* should be used as a suffix for global addressing, eg.
23
+; mov eax, [foo GOT_ebx]
27
+; - picgetgot computes the GOT address into the given register in PIC
28
+; mode, otherwise does nothing. You need to do this before using GLOBAL.
30
+; - picpush and picpop respectively push and pop the given register
31
+; in PIC mode, otherwise do nothing. You should always use them around
32
+; picgetgot except when sure that the register is no longer used and is
33
+; being restored later by other means.
35
+; - picesp is defined to compensate the changing of esp when pushing
36
+; a register into the stack, eg.
39
+; mov eax, [picesp + 12]
43
+; mov eax, [esp + 12]
45
+; - picjmp jumps to a global address:
47
+; picjmp ebx, far_address
52
+ EXTERN _GLOBAL_OFFSET_TABLE_
53
+ %define GOT_eax + eax wrt ..gotoff
54
+ %define GOT_ebx + ebx wrt ..gotoff
55
+ %define GOT_ecx + ecx wrt ..gotoff
56
+ %define GOT_edx + edx wrt ..gotoff
61
+ add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%getgot wrt ..gotpc
69
+ %define picesp esp+4
71
+ jmp [%2 + %1 wrt ..got]
90
Index: libsdl1.2-1.2.10/src/hermes/mmxp2_32.asm
91
===================================================================
92
--- libsdl1.2-1.2.10.orig/src/hermes/mmxp2_32.asm 2006-05-01 10:02:38.000000000 +0200
93
+++ libsdl1.2-1.2.10/src/hermes/mmxp2_32.asm 2006-05-31 15:32:58.000000000 +0200
95
; are, they're terrible on p5 MMXs, but less so on pIIs. Someone needs to
96
; optimise them for p5 MMXs..
98
+%include "common.inc"
109
+ picjmp ecx, _mmxreturn
111
_ConvertMMXpII32_16BGR555:
119
+ picjmp ecx, _mmxreturn
121
%ifidn __OUTPUT_FORMAT__,elf
122
section .note.GNU-stack noalloc noexec nowrite progbits
123
Index: libsdl1.2-1.2.10/src/hermes/x86_main.asm
124
===================================================================
125
--- libsdl1.2-1.2.10.orig/src/hermes/x86_main.asm 2006-05-01 10:02:38.000000000 +0200
126
+++ libsdl1.2-1.2.10/src/hermes/x86_main.asm 2006-05-31 15:22:16.000000000 +0200
128
; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
131
+%include "common.inc"
136
Index: libsdl1.2-1.2.10/src/hermes/x86p_16.asm
137
===================================================================
138
--- libsdl1.2-1.2.10.orig/src/hermes/x86p_16.asm 2006-05-01 10:02:38.000000000 +0200
139
+++ libsdl1.2-1.2.10/src/hermes/x86p_16.asm 2006-05-31 15:22:16.000000000 +0200
141
; Used with permission.
145
+%include "common.inc"
149
GLOBAL _ConvertX86p16_32RGB888
156
+ picjmp ebx, _x86return
166
+ picjmp ebx, _x86return
176
+ picjmp ebx, _x86return
186
+ picjmp ebx, _x86return
196
+ picjmp ebx, _x86return
206
+ picjmp ebx, _x86return
216
+ picjmp ebx, _x86return
226
+ picjmp ebx, _x86return
228
%ifidn __OUTPUT_FORMAT__,elf
229
section .note.GNU-stack noalloc noexec nowrite progbits
230
Index: libsdl1.2-1.2.10/src/hermes/x86p_32.asm
231
===================================================================
232
--- libsdl1.2-1.2.10.orig/src/hermes/x86p_32.asm 2006-05-01 10:02:38.000000000 +0200
233
+++ libsdl1.2-1.2.10/src/hermes/x86p_32.asm 2006-05-31 15:22:16.000000000 +0200
235
; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
238
+%include "common.inc"
248
+ picjmp ebx, _x86return
258
+ picjmp ebx, _x86return
268
+ picjmp ebx, _x86return
278
+ picjmp ebx, _x86return
288
+ picjmp ebx, _x86return
298
+ picjmp ebx, _x86return
308
+ picjmp ebx, _x86return
318
+ picjmp ebx, _x86return
328
+ picjmp ebx, _x86return
338
+ picjmp ebx, _x86return
345
.L2: ; End of short loop
348
+ picjmp ebx, _x86return
358
+ picjmp ebx, _x86return
368
+ picjmp ebx, _x86return
378
+ picjmp ebx, _x86return
388
+ picjmp ebx, _x86return
398
+ picjmp ebx, _x86return
408
+ picjmp ebx, _x86return
418
+ picjmp ebx, _x86return
422
@@ -1039,7 +1058,8 @@
428
+ picjmp ebx, _x86return
430
%ifidn __OUTPUT_FORMAT__,elf
431
section .note.GNU-stack noalloc noexec nowrite progbits