OSDN Git Service

* config/darwin.c (no_dead_strip): Add.
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Jul 2004 05:54:27 +0000 (05:54 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Jul 2004 05:54:27 +0000 (05:54 +0000)
        (HAVE_DEAD_STRIP): Add.
        (darwin_emit_unwind_label): Ensure that we don't dead code strip
        the .eh label.
Radar 3668092

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84444 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/darwin.c

index e5fd185..12ee0ae 100644 (file)
@@ -1,3 +1,10 @@
+2004-07-09  Mike Stump  <mrs@apple.com>
+
+       * config/darwin.c (no_dead_strip): Add.
+       (HAVE_DEAD_STRIP): Add.
+       (darwin_emit_unwind_label): Ensure that we don't dead code strip
+       the .eh label.
+
 2004-07-09  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * tree-ssa-loop-im.c: New file.
index 17d7fb7..e46690c 100644 (file)
@@ -1339,6 +1339,15 @@ darwin_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
     darwin_make_decl_one_only (decl);
 }
 
+#define HAVE_DEAD_STRIP 0
+
+static void
+no_dead_strip (FILE *file, const char *lab)
+{
+  if (HAVE_DEAD_STRIP)
+    fprintf (file, ".no_dead_strip %s\n", lab);
+}
+
 /* Emit a label for an FDE, making it global and/or weak if appropriate. 
    The third parameter is nonzero if this is for exception handling.
    The fourth parameter is nonzero if this is just a placeholder for an
@@ -1388,7 +1397,15 @@ darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
     fprintf (file, ".weak_definition %s\n", lab);
 
   if (empty)
-    fprintf (file, "%s = 0\n", lab);
+    {
+      fprintf (file, "%s = 0\n", lab);
+
+      /* Mark the absolute .eh and .eh1 style labels as needed to
+        ensure that we don't dead code strip them and keep such
+        labels from another instantiation point until we can fix this
+        properly with group comdat support.  */
+      no_dead_strip (file, lab);
+    }
   else
     fprintf (file, "%s:\n", lab);