aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2012-08-07 16:08:49 +0000
committerSandra Loosemore <sandra@gcc.gnu.org>2012-08-07 12:08:49 -0400
commit3e6011cfebedfb66b92c87e6d2add9237188819e (patch)
treeac5f1054288e8389349f643548ad266bf0455668 /gcc/except.c
parent070ecdfd0300a9aebdaaff78f8e10184e9152042 (diff)
downloadgcc-3e6011cfebedfb66b92c87e6d2add9237188819e.zip
gcc-3e6011cfebedfb66b92c87e6d2add9237188819e.tar.gz
gcc-3e6011cfebedfb66b92c87e6d2add9237188819e.tar.bz2
except.c (switch_to_exception_section): Place tables for DECL_ONE_ONLY functions in comdat groups.
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
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 10fc26e..605d8d7 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -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