4 struct ObjCClass
* __ptrauth_objc_isa_pointer isa
;
5 struct ObjCClass
* __ptrauth_objc_super_pointer superclass
;
8 struct ObjCClass_ro
*data
;
13 uint32_t instanceStart
;
14 uint32_t instanceSize
;
19 const uint8_t * ivarLayout
;
22 struct ObjCMethodList
* __ptrauth_objc_method_list_pointer baseMethodList
;
23 struct protocol_list_t
* baseProtocols
;
24 const struct ivar_list_t
* ivars
;
26 const uint8_t * weakIvarLayout
;
27 struct property_list_t
*baseProperties
;
36 struct ObjCMethodList
{
37 uint32_t sizeAndFlags
;
39 struct ObjCMethod methods
[];
42 struct ObjCMethodSmall
{
48 struct ObjCMethodListSmall
{
49 uint32_t sizeAndFlags
;
51 struct ObjCMethodSmall methods
[];
55 extern struct ObjCClass OBJC_METACLASS_$_NSObject
;
56 extern struct ObjCClass OBJC_CLASS_$_NSObject
;
59 struct ObjCClass_ro FooMetaclass_ro
= {
66 struct ObjCClass FooMetaclass
= {
67 .isa
= &OBJC_METACLASS_$_NSObject
,
68 .superclass
= &OBJC_METACLASS_$_NSObject
,
69 .cachePtr
= &_objc_empty_cache
,
70 .data
= &FooMetaclass_ro
,
75 extern "C" void myMethod1(id self __unused
, SEL _cmd
) {
76 testprintf("myMethod1\n");
77 testassert(_cmd
== @
selector(myMethod1
));
82 extern "C" void myMethod2(id self __unused
, SEL _cmd
) {
83 testprintf("myMethod2\n");
84 testassert(_cmd
== @
selector(myMethod2
));
89 extern "C" void myMethod3(id self __unused
, SEL _cmd
) {
90 testprintf("myMethod3\n");
91 testassert(_cmd
== @
selector(myMethod3
));
95 int ranMyReplacedMethod1
;
96 extern "C" void myReplacedMethod1(id self __unused
, SEL _cmd
) {
97 testprintf("myReplacedMethod1\n");
98 testassert(_cmd
== @
selector(myMethod1
));
99 ranMyReplacedMethod1
= 1;
102 int ranMyReplacedMethod2
;
103 extern "C" void myReplacedMethod2(id self __unused
, SEL _cmd
) {
104 testprintf("myReplacedMethod2\n");
105 testassert(_cmd
== @
selector(myMethod2
));
106 ranMyReplacedMethod2
= 1;
110 uintptr_t a
, b
, c
, d
, e
, f
, g
;
113 int ranMyMethodStret
;
114 extern "C" BigStruct
myMethodStret(id self __unused
, SEL _cmd
) {
115 testprintf("myMethodStret\n");
116 testassert(_cmd
== @
selector(myMethodStret
));
117 ranMyMethodStret
= 1;
122 int ranMyReplacedMethodStret
;
123 extern "C" BigStruct
myReplacedMethodStret(id self __unused
, SEL _cmd
) {
124 testprintf("myReplacedMethodStret\n");
125 testassert(_cmd
== @
selector(myMethodStret
));
126 ranMyReplacedMethodStret
= 1;
131 extern struct ObjCMethodList Foo_methodlistSmall
;
134 .section __TEXT,__cstring
144 .asciz "myMethodStret
"
145 _MyMethodNullTypesName:
146 .asciz "myMethodNullTypes
"
148 .asciz "{BigStruct
=QQQQQQQ
}16@
0:8"
153 .section __DATA,__objc_selrefs,literal_pointers,no_dead_strip
160 _MyMethodStretNameRef:
161 .quad _MyMethodStretName
162 _MyMethodNullTypesNameRef:
163 .quad _MyMethodNullTypesName
167 .section __DATA,__objc_selrefs,literal_pointers,no_dead_strip
174 _MyMethodStretNameRef:
175 .long _MyMethodStretName
176 _MyMethodNullTypesNameRef:
177 .long _MyMethodNullTypesName
181 #if MUTABLE_METHOD_LIST
182 asm(".section __DATA,__objc_methlist\n");
184 asm(".section __TEXT,__objc_methlist\n");
189 _Foo_methodlistSmall:
190 .long 12 | 0x80000000
193 .long _MyMethod1NameRef - .
194 .long _BoringMethodType - .
197 .long _MyMethod2NameRef - .
198 .long _BoringMethodType - .
201 .long _MyMethod3NameRef - .
202 .long _BoringMethodType - .
205 .long _MyMethodStretNameRef - .
207 .long _myMethodStret - .
209 .long _MyMethodNullTypesNameRef - .
214 struct ObjCClass_ro Foo_ro
= {
218 .baseMethodList
= &Foo_methodlistSmall
,
221 struct ObjCClass FooClass
= {
222 .isa
= &FooMetaclass
,
223 .superclass
= &OBJC_CLASS_$_NSObject
,
224 .cachePtr
= &_objc_empty_cache
,
229 @interface Foo
: NSObject
234 - (BigStruct
)myMethodStret
;