Skip to content

Commit 0729726

Browse files
committed
fix objc_msgSend.x86-32.S for win32
1 parent ebed846 commit 0729726

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

common.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if defined(__WIN32__) || defined(__APPLE__)
1+
#if (defined(_WIN32) && defined(__i386__)) || defined(__APPLE__)
22
#define CDECL(symbol) _##symbol
33
#else
44
#define CDECL(symbol) symbol

objc_msgSend.x86-32.S

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
push %ecx # _cmd
5555
push %eax # &self
5656
.cfi_def_cfa_offset 12
57-
call slowMsgLookup@PLT
57+
call CDECL(slowMsgLookup)@PLT
5858
add $8, %esp # restore the stack
5959

6060

@@ -65,8 +65,14 @@
6565
7:
6666
popl %ebx;
6767
8:
68+
#if __ELF__
69+
# ELF can support GOT-relative addressing;
70+
# PE/COFF and Mach-O need a text relocation.
6871
addl $_GLOBAL_OFFSET_TABLE_+(8b-7b), %ebx
6972
leal SmallObjectClasses@GOTOFF(%ebx), %eax
73+
#else
74+
leal CDECL(SmallObjectClasses), %eax
75+
#endif
7076
mov (%eax), %eax
7177
popl %ebx
7278
jmp 1b

0 commit comments

Comments
 (0)