This is a wrong-code bug, identified by newer Darwin linkers, tested
on x86_64, i686 and aarch64 Darwin, pushed to trunk, backports to open
branches to follow, thanks,
Iain

--- 8< ---

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]>
---
 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 f4726ab0e57..5812d61765b 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;
-- 
2.50.1 (Apple Git-155)

Reply via email to