]> git.saurik.com Git - apple/objc4.git/blob - runtime/Messengers.subproj/objc-msg-stub-ppc.s
objc4-266.tar.gz
[apple/objc4.git] / runtime / Messengers.subproj / objc-msg-stub-ppc.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 .picsymbol_stub
36 L_objc_msgSend$stub:
37 .indirect_symbol _objc_msgSend
38 mflr r0
39 bcl 20,31,1f
40 1:
41 mflr r11
42 addis r11,r11,ha16(L_objc_msgSend$lazy_ptr-1b)
43 mtlr r0
44 lwz r12,lo16(L_objc_msgSend$lazy_ptr-1b)(r11)
45 mtctr r12
46 addi r11,r11,lo16(L_objc_msgSend$lazy_ptr-1b)
47 bctr
48
49 .data
50 .lazy_symbol_pointer
51 L_objc_msgSend$lazy_ptr:
52 .indirect_symbol _objc_msgSend
53 .long dyld_stub_binding_helper
54
55 .text
56 .align 4
57 .globl _objc_msgSend_stub
58
59 _objc_msgSend_stub:
60 b L_objc_msgSend$stub