[gcc r17-2394] Darwin, Objective-C/C++: Globalise protocol ref metadata symbols.

Iain D Sandoe via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:9d72b82d10d9a046b70798a8f6381123cd60ff6a

commit r17-2394-g9d72b82d10d9a046b70798a8f6381123cd60ff6a
Author: Iain Sandoe <[email protected]>
Date:   Mon Jul 13 09:05:25 2026 +0100

    Darwin, Objective-C/C++: Globalise protocol ref metadata symbols.
    
    Newer versions of the system static linker complain if Protocol reference
    lists are not introduced with a global symbol.
    
    gcc/ChangeLog:
    
            * config/darwin.cc (darwin_globalize_label): Handle Protocol
            references.
            (darwin_label_is_anonymous_local_objc_name): Likewise.
    
    Signed-off-by: Iain Sandoe <[email protected]>

Diff:
---
 gcc/config/darwin.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/darwin.cc b/gcc/config/darwin.cc
index f4726ab0e57e..5812d61765b9 100644
--- a/gcc/config/darwin.cc
+++ b/gcc/config/darwin.cc
@@ -2008,7 +2008,7 @@ darwin_globalize_label (FILE *stream, const char *name)
     return;
   if (startswith (name+6, "LabelPro"))
     default_globalize_label (stream, name);
-  if (startswith (name+6, "Protocol_"))
+  if (startswith (name+6, "Protocol"))
     default_globalize_label (stream, name);
 }
 
@@ -2067,7 +2067,7 @@ darwin_label_is_anonymous_local_objc_name (const char *name)
     return false;
   else if (startswith ((const char *)p, "Protocol"))
     {
-      if (p[8] == '_' || p[8] == 'I' || p[8] == 'P'
+      if (p[8] == '_' || p[8] == 'I' || p[8] == 'P' || p[8] == 'R'
 	  || p[8] == 'M' || p[8] == 'C' || p[8] == 'O')
 	return false;
       return true;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.