]> gcc.gnu.org Git - gcc.git/commitdiff
darwin.h (ASM_DECLARE_FUNCTION_NAME): Define.
authorStan Shebs <shebs@apple.com>
Tue, 4 Sep 2001 20:58:19 +0000 (20:58 +0000)
committerStan Shebs <shebs@gcc.gnu.org>
Tue, 4 Sep 2001 20:58:19 +0000 (20:58 +0000)
        * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Define.
        * config/darwin.c (machopic_stub_name): Account for internally
        generated lib calls such as memcpy.

From-SVN: r45385

gcc/ChangeLog
gcc/config/darwin.c
gcc/config/darwin.h

index 1de0a42fb775d0c2c563b8dfee60a9189a5cbe05..9e6913c08d6c887714b6ccbe3326e4e52d3b042d 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-04  Stan Shebs  <shebs@apple.com>
+
+       * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Define.
+       * config/darwin.c (machopic_stub_name): Account for internally
+       generated lib calls such as memcpy.
+
 2001-09-04  Richard Henderson  <rth@redhat.com>
 
        * unwind.h (_UA_END_OF_STACK): New flag.
index 3f8cffdd2301e71b9d168c0edf1444147e9e2f6f..a46d46b7d5fff8addfd29d1eb7a4c5c7fbf003c4 100644 (file)
@@ -324,14 +324,22 @@ machopic_stub_name (name)
      const char *name;
 {
   tree temp, ident = get_identifier (name);
-  
+  const char *tname;
+
   for (temp = machopic_stubs;
        temp != NULL_TREE; 
        temp = TREE_CHAIN (temp))
     {
       if (ident == TREE_VALUE (temp))
        return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
-      if (strcmp (name, IDENTIFIER_POINTER (TREE_VALUE (temp))) == 0)
+      tname = IDENTIFIER_POINTER (TREE_VALUE (temp));
+      if (strcmp (name, tname) == 0)
+       return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
+      /* A library call name might not be section-encoded yet, so try
+        it against a stripped name.  */
+      if (name[0] != '!'
+         && tname[0] == '!'
+         && strcmp (name, tname + 4) == 0)
        return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
     }
 
index efa43f2138a76b323abe248d9a401dc3a849585b..9124307755c46012127ba2dbb0ae563d0f2827e3 100644 (file)
@@ -215,6 +215,22 @@ do { text_section ();                                                      \
     ASM_OUTPUT_LABEL (FILE, xname);                                     \
   } while (0)
 
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
+  do {                                                                 \
+    char *xname = NAME;                                                 \
+    if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF)             \
+      xname = IDENTIFIER_POINTER (DECL_NAME (DECL));                    \
+    if ((TREE_STATIC (DECL)                                             \
+        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
+        || DECL_INITIAL (DECL))                                         \
+      machopic_define_name (xname);                                     \
+    if ((TREE_STATIC (DECL)                                             \
+        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
+        || DECL_INITIAL (DECL))                                         \
+      ENCODE_SECTION_INFO (DECL);                                      \
+    ASM_OUTPUT_LABEL (FILE, xname);                                     \
+  } while (0)
+
 /* Wrap new method names in quotes so the assembler doesn't gag.
    Make Objective-C internal symbols local.  */
 
This page took 0.078634 seconds and 5 git commands to generate.