3 #include <mach/shared_region.h>
8 # define LOGPTRSIZE "3"
10 # define PTR " .long "
12 # define LOGPTRSIZE "2"
16 #define str2(x) str(x)
19 // not id to avoid ARC operations because the class doesn't implement RR methods
20 void* nop(void* self) { return self; }
24 ".globl _OBJC_CLASS_$_Super \n"
25 ".section __DATA,__objc_data \n"
27 "_OBJC_CLASS_$_Super: \n"
28 PTR "_OBJC_METACLASS_$_Super \n"
30 PTR "__objc_empty_cache \n"
33 // pad to OBJC_MAX_CLASS_SIZE
62 "_OBJC_METACLASS_$_Super: \n"
63 PTR "_OBJC_METACLASS_$_Super \n"
64 PTR "_OBJC_CLASS_$_Super \n"
65 PTR "__objc_empty_cache \n"
68 // pad to OBJC_MAX_CLASS_SIZE
105 PTR "L_super_name \n"
107 PTR "L_evil_methods \n"
109 PTR "L_good_methods \n"
112 PTR "L_super_ivars \n"
124 PTR "L_super_name \n"
126 PTR "L_evil_methods \n"
128 PTR "L_good_methods \n"
135 ".globl _OBJC_CLASS_$_Sub \n"
136 ".section __DATA,__objc_data \n"
138 "_OBJC_CLASS_$_Sub: \n"
139 PTR "_OBJC_METACLASS_$_Sub \n"
140 PTR "_OBJC_CLASS_$_Super \n"
141 PTR "__objc_empty_cache \n"
144 // pad to OBJC_MAX_CLASS_SIZE
173 "_OBJC_METACLASS_$_Sub: \n"
174 PTR "_OBJC_METACLASS_$_Super \n"
175 PTR "_OBJC_METACLASS_$_Super \n"
176 PTR "__objc_empty_cache \n"
178 PTR "L_sub_meta_ro \n"
179 // pad to OBJC_MAX_CLASS_SIZE
218 PTR "L_evil_methods \n"
220 PTR "L_good_methods \n"
237 PTR "L_evil_methods \n"
239 PTR "L_good_methods \n"
247 ".long 3*"PTRSIZE" \n"
251 PTR str2(SHARED_REGION_BASE+SHARED_REGION_SIZE-PAGE_MAX_SIZE) " \n"
254 ".long 3*"PTRSIZE" \n"
264 ".long 4*"PTRSIZE" \n"
266 PTR "L_super_ivar_offset \n"
267 PTR "L_super_ivar_name \n"
268 PTR "L_super_ivar_type \n"
269 ".long "LOGPTRSIZE" \n"
273 ".long 4*"PTRSIZE" \n"
275 PTR "L_sub_ivar_offset \n"
276 PTR "L_sub_ivar_name \n"
277 PTR "L_sub_ivar_type \n"
278 ".long "LOGPTRSIZE" \n"
281 "L_super_ivar_offset: \n"
283 "L_sub_ivar_offset: \n"
287 "L_super_name: .ascii \"Super\\0\" \n"
288 "L_sub_name: .ascii \"Sub\\0\" \n"
289 "L_load: .ascii \"load\\0\" \n"
290 "L_self: .ascii \"self\\0\" \n"
291 "L_super_ivar_name: .ascii \"super_ivar\\0\" \n"
292 "L_super_ivar_type: .ascii \"c\\0\" \n"
293 "L_sub_ivar_name: .ascii \"sub_ivar\\0\" \n"
294 "L_sub_ivar_type: .ascii \"@\\0\" \n"
297 ".section __DATA,__objc_classlist \n"
299 PTR "_OBJC_CLASS_$_Super \n"
302 PTR "_OBJC_CLASS_$_Sub \n"
305 ".section __DATA,__objc_nlclslist \n"
307 PTR "_OBJC_CLASS_$_Super \n"
310 PTR "_OBJC_CLASS_$_Sub \n"