]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
except.c (switch_to_exception_section): Place tables for DECL_ONE_ONLY functions...
authorPaul Brook <paul@codesourcery.com>
Tue, 7 Aug 2012 16:08:49 +0000 (16:08 +0000)
committerSandra Loosemore <sandra@gcc.gnu.org>
Tue, 7 Aug 2012 16:08:49 +0000 (12:08 -0400)
2012-08-07  Paul Brook  <paul@codesourcery.com>
    Sandra Loosemore  <sandra@codesourcery.com>

gcc/
* except.c (switch_to_exception_section): Place tables for
DECL_ONE_ONLY functions in comdat groups.

Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
From-SVN: r190206

gcc/ChangeLog
gcc/except.c

index 43b0b9204134672dc09cc23b997af4c2c2734df9..5896e0b7f11301c2a755d7ad539256864a723ca7 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-07  Paul Brook  <paul@codesourcery.com>
+           Sandra Loosemore  <sandra@codesourcery.com>
+
+       * except.c (switch_to_exception_section): Place tables for
+       DECL_ONE_ONLY functions in comdat groups.
+
 2012-08-07  Richard Guenther  <rguenther@suse.de>
 
        * tree-flow.h (copy_ssa_name_fn): New function.
index 10fc26e1d7ca3864981af7474b3578e7a9d299a8..605d8d7b829d9257f7eafe9b68367bce724dca47 100644 (file)
@@ -2777,11 +2777,16 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname))
            flags = SECTION_WRITE;
 
 #ifdef HAVE_LD_EH_GC_SECTIONS
-         if (flag_function_sections)
+         if (flag_function_sections
+             || (DECL_ONE_ONLY (current_function_decl) && HAVE_COMDAT_GROUP))
            {
              char *section_name = XNEWVEC (char, strlen (fnname) + 32);
+             /* The EH table must match the code section, so only mark
+                it linkonce if we have COMDAT groups to tie them together.  */
+             if (DECL_ONE_ONLY (current_function_decl) && HAVE_COMDAT_GROUP)
+               flags |= SECTION_LINKONCE;
              sprintf (section_name, ".gcc_except_table.%s", fnname);
-             s = get_section (section_name, flags, NULL);
+             s = get_section (section_name, flags, current_function_decl);
              free (section_name);
            }
          else