]> git.saurik.com Git - apple/objc4.git/blob - runtime/Messengers.subproj/objc-msg-stub-i386.s
objc4-266.tar.gz
[apple/objc4.git] / runtime / Messengers.subproj / objc-msg-stub-i386.s
1 /*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 2004 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 /*
27 * Interposing support.
28 * When OBJC_ALLOW_INTERPOSING is set, calls to objc_msgSend_rtp
29 * jump to the ordinary messenger via this stub. If objc_msgSend
30 * itself is interposed, dyld will find and change this stub.
31 * This stub must be compiled into a separate linker module.
32 */
33
34 .data
35 .align 4, 0x90
36 L_get_pc_thunk.edx:
37 movl (%esp,1), %edx
38 ret
39
40 .data
41 .picsymbol_stub
42 L_objc_msgSend$stub:
43 .indirect_symbol _objc_msgSend
44 call L_get_pc_thunk.edx
45 1:
46 movl L_objc_msgSend$lz-1b(%edx),%ecx
47 jmp %ecx
48 L_objc_msgSend$stub_binder:
49 lea L_objc_msgSend$lz-1b(%edx),%eax
50 pushl %eax
51 jmp dyld_stub_binding_helper
52 nop
53
54 .data
55 .lazy_symbol_pointer
56 L_objc_msgSend$lz:
57 .indirect_symbol _objc_msgSend
58 .long L_objc_msgSend$stub_binder
59
60 .text
61 .align 4, 0x90
62 .globl _objc_msgSend_stub
63 _objc_msgSend_stub:
64 jmp L_objc_msgSend$stub