summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
174c7ba)
PR objective-c++/41595
* config/darwin.c (darwin_label_is_anonymous_local_objc_name):
New function to recognize objective c/c++ internal symbols,
including mangled ones.
* config/darwin.h (ASM_OUTPUT_LABELREF): Use
darwin_label_is_anonymous_local_objc_name to detect both
mangled and clear ObjC internal symbols.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155500
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-12-29 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ 2009-10-06 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR objective-c++/41595
+ * config/darwin.c (darwin_label_is_anonymous_local_objc_name):
+ New function to recognize objective c/c++ internal symbols,
+ including mangled ones.
+ * config/darwin.h (ASM_OUTPUT_LABELREF): Use
+ darwin_label_is_anonymous_local_objc_name to detect both
+ mangled and clear ObjC internal symbols.
+
2009-12-28 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/41344
2009-12-28 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/41344
default_globalize_label (stream, name);
}
default_globalize_label (stream, name);
}
+/* This routine returns non-zero if 'name' starts with the special objective-c
+ anonymous file-scope static name. It accommodates c++'s mangling of such
+ symbols (in this case the symbols will have form _ZL{d}*_OBJC_* d=digit). */
+
+int
+darwin_label_is_anonymous_local_objc_name (const char *name)
+{
+ const unsigned char *p = (const unsigned char *) name;
+ if (*p != '_')
+ return 0;
+ if (p[1] == 'Z' && p[2] == 'L')
+ {
+ p += 3;
+ while (*p >= '0' && *p <= '9')
+ p++;
+ }
+ return (!strncmp ((const char *)p, "_OBJC_", 6));
+}
+
void
darwin_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED,
void
darwin_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED,
} while (0)
/* Wrap new method names in quotes so the assembler doesn't gag.
} while (0)
/* Wrap new method names in quotes so the assembler doesn't gag.
- Make Objective-C internal symbols local. */
+ Make Objective-C internal symbols local and in doing this, we need
+ to accommodate the name mangling done by c++ on file scope locals. */
+
+
+int darwin_label_is_anonymous_local_objc_name (const char *name);
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
} \
else if (xname[0] == '+' || xname[0] == '-') \
fprintf (FILE, "\"%s\"", xname); \
} \
else if (xname[0] == '+' || xname[0] == '-') \
fprintf (FILE, "\"%s\"", xname); \
- else if (!strncmp (xname, "_OBJC_", 6)) \
+ else if (darwin_label_is_anonymous_local_objc_name (xname)) \
fprintf (FILE, "L%s", xname); \
else if (!strncmp (xname, ".objc_class_name_", 17)) \
fprintf (FILE, "%s", xname); \
fprintf (FILE, "L%s", xname); \
else if (!strncmp (xname, ".objc_class_name_", 17)) \
fprintf (FILE, "%s", xname); \