summaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-28 18:11:28 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-28 18:11:28 +0000
commit0a0111127d9280e4c9270380f9abb3d290dd1456 (patch)
treeb8b495ff787a48ab2e5b9ab8e18f98a7e4c17bcf /gcc/except.c
parent26e1261a7d5763cee4e7280239cd64e0ad6b3cdb (diff)
downloadgcc-0a0111127d9280e4c9270380f9abb3d290dd1456.tar.gz
* except.h (output_function_exception_table): Add 'const char*' param.
* except.c (switch_to_exception_section): Add 'const char*' param. If named sections are supported and HAVE_LD_EH_GC_SECTIONS is defined and flag_function_sections is set, use a function-specific section. (output_function_exception_table): Add 'const char*' param. Adjust call to switch_to_exception_section. * final.c (rest_of_handle_final): Adjust calls to output_function_exception_table. * configure.ac (HAVE_LD_EH_GC_SECTIONS): New check. * config.in: Regenerate. * configure: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118107 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 30dafbb8073..306916968e8 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -3520,7 +3520,7 @@ sjlj_output_call_site_table (void)
/* Switch to the section that should be used for exception tables. */
static void
-switch_to_exception_section (void)
+switch_to_exception_section (const char * ARG_UNUSED (fnname))
{
if (exception_section == 0)
{
@@ -3539,6 +3539,16 @@ switch_to_exception_section (void)
}
else
flags = SECTION_WRITE;
+#ifdef HAVE_LD_EH_GC_SECTIONS
+ if (flag_function_sections)
+ {
+ char *section_name = xmalloc (strlen (fnname) + 32);
+ sprintf (section_name, ".gcc_except_table.%s", fnname);
+ exception_section = get_section (section_name, flags, NULL);
+ free (section_name);
+ }
+ else
+#endif
exception_section = get_section (".gcc_except_table", flags, NULL);
}
else
@@ -3599,7 +3609,7 @@ output_ttype (tree type, int tt_format, int tt_format_size)
}
void
-output_function_exception_table (void)
+output_function_exception_table (const char * ARG_UNUSED (fnname))
{
int tt_format, cs_format, lp_format, i, n;
#ifdef HAVE_AS_LEB128
@@ -3627,7 +3637,7 @@ output_function_exception_table (void)
/* Note that varasm still thinks we're in the function's code section.
The ".endp" directive that will immediately follow will take us back. */
#else
- switch_to_exception_section ();
+ switch_to_exception_section (fnname);
#endif
/* If the target wants a label to begin the table, emit it here. */