From 45cc478337efd4f1f5f62bfd70857ab5679aae7a Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Sat, 10 Jul 2004 05:54:27 +0000 Subject: [PATCH] darwin.c (no_dead_strip): Add. * 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. Radar 3668092 From-SVN: r84444 --- gcc/ChangeLog | 7 +++++++ gcc/config/darwin.c | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e5fd185dfd9..12ee0ae2e4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-09 Mike Stump + + * 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 * tree-ssa-loop-im.c: New file. diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 17d7fb77f03..e46690c74cd 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -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); -- 2.30.2