From ecd5727c0a662a8fea6b5f8eac6f3f15bf5ef851 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Mon, 2 May 2022 19:42:49 +0100 Subject: Objective-C, NeXT: Adjust symbol marking to match host tools. Current host tools mark some additional symbols as 'no dead strip' and also expose one additional group to the linker. This does not affect older Darwin versions or x86_64, but omitting these changes results in link errors for aarch64. Signed-off-by: Iain Sandoe gcc/ChangeLog: * config/darwin.cc (darwin_label_is_anonymous_local_objc_name): Make protocol class methods linker-visible. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.cc (next_runtime_abi_02_protocol_decl): Do not dead-strip the runtime meta-data symbols. (build_v2_classrefs_table): Likewise. (build_v2_protocol_list_address_table): Likewise. --- gcc/objc/objc-next-runtime-abi-02.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/objc') diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc index e50ca6e..9ea63b1 100644 --- a/gcc/objc/objc-next-runtime-abi-02.cc +++ b/gcc/objc/objc-next-runtime-abi-02.cc @@ -1033,6 +1033,7 @@ next_runtime_abi_02_protocol_decl (tree p) else decl = start_var_decl (objc_v2_protocol_template, buf); OBJCMETA (decl, objc_meta, meta_protocol); + DECL_PRESERVE_P (decl) = 1; return decl; } @@ -2115,8 +2116,8 @@ build_v2_classrefs_table (void) expr = convert (objc_class_type, build_fold_addr_expr (expr)); } /* The runtime wants this, even if it appears unused, so we must force the - output. - DECL_PRESERVE_P (decl) = 1; */ + output. */ + DECL_PRESERVE_P (decl) = 1; finish_var_decl (decl, expr); } } @@ -2318,6 +2319,7 @@ build_v2_protocol_list_address_table (void) expr = convert (objc_protocol_type, build_fold_addr_expr (ref->refdecl)); OBJCMETA (decl, objc_meta, meta_label_protocollist); finish_var_decl (decl, expr); + DECL_PRESERVE_P (decl) = 1; } /* TODO: delete the vec. */ -- cgit v1.1