From 9ffadf2941c68379100aed59b2434a65a5bfd17f Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 28 Oct 2015 21:00:57 +0000 Subject: [PATCH] * write nil instead of a reference to _objc_empty_vtable for iOS and the iOS simulator (based on clang source) git-svn-id: trunk@32182 - --- compiler/objcgutl.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/objcgutl.pas b/compiler/objcgutl.pas index cf113b076e..319619a8a4 100644 --- a/compiler/objcgutl.pas +++ b/compiler/objcgutl.pas @@ -1493,9 +1493,10 @@ procedure tobjcrttiwriter_nonfragile.gen_objc_classes_sections(list:TAsmList; ob ObjCEmptyCacheVar:=current_asmdata.RefAsmSymbol(target_info.Cprefix+'_objc_empty_cache'); list.Concat(Tai_const.Create_sym(ObjCEmptyCacheVar)); { pointer to vtable } - if not assigned(ObjCEmptyVtableVar) then + if not assigned(ObjCEmptyVtableVar) and + not(target_info.system in [system_arm_darwin,system_aarch64_darwin,system_i386_iphonesim,system_x86_64_iphonesim]) then ObjCEmptyVtableVar:=current_asmdata.RefAsmSymbol(target_info.Cprefix+'_objc_empty_vtable'); - list.Concat(Tai_const.Create_sym(ObjCEmptyVtableVar)); + ConcatSymOrNil(list,ObjCEmptyVtableVar); { the read-only part } list.Concat(Tai_const.Create_sym(metarosym)); @@ -1509,7 +1510,7 @@ procedure tobjcrttiwriter_nonfragile.gen_objc_classes_sections(list:TAsmList; ob { pointer to cache } list.Concat(Tai_const.Create_sym(ObjCEmptyCacheVar)); { pointer to vtable } - list.Concat(Tai_const.Create_sym(ObjCEmptyVtableVar)); + ConcatSymOrNil(list,ObjCEmptyVtableVar); { the read-only part } list.Concat(Tai_const.Create_sym(rosym));