public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-88] Objective-C, NeXT: Adjust symbol marking to match host tools.
Date: Tue,  3 May 2022 18:39:00 +0000 (GMT)	[thread overview]
Message-ID: <20220503183900.282063959E6E@sourceware.org> (raw)

https://gcc.gnu.org/g:ecd5727c0a662a8fea6b5f8eac6f3f15bf5ef851

commit r13-88-gecd5727c0a662a8fea6b5f8eac6f3f15bf5ef851
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon May 2 19:42:49 2022 +0100

    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 <iain@sandoe.co.uk>
    
    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.

Diff:
---
 gcc/config/darwin.cc                 | 2 ++
 gcc/objc/objc-next-runtime-abi-02.cc | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/config/darwin.cc b/gcc/config/darwin.cc
index f065a13d73d..1b3de338926 100644
--- a/gcc/config/darwin.cc
+++ b/gcc/config/darwin.cc
@@ -1936,6 +1936,8 @@ darwin_label_is_anonymous_local_objc_name (const char *name)
     }
   else if (startswith ((const char *)p, "ClassMethods"))
     return false;
+  else if (startswith ((const char *)p, "ClassProtocols"))
+    return false;
   else if (startswith ((const char *)p, "Instance"))
     {
       if (p[8] == 'I' || p[8] == 'M')
diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc
index e50ca6e89f5..9ea63b189c7 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.  */


                 reply	other threads:[~2022-05-03 18:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220503183900.282063959E6E@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).