aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2005-12-10 00:20:16 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2005-12-10 00:20:16 +0000
commit0f67af1ce30cdee9273baa65166fabbcb6eb04b8 (patch)
tree7670fde6cf99d8c4dcfee7a32b97bae2259e7736 /gcc/varasm.c
parent386e0f8c3e02ce5f2e88395c9180f0f1ad1c42fd (diff)
downloadgcc-0f67af1ce30cdee9273baa65166fabbcb6eb04b8.zip
gcc-0f67af1ce30cdee9273baa65166fabbcb6eb04b8.tar.gz
gcc-0f67af1ce30cdee9273baa65166fabbcb6eb04b8.tar.bz2
dwarf2out.c (default_eh_frame_section): Delete, moving handling of EH_FRAME_SECTION_NAME into...
* dwarf2out.c (default_eh_frame_section): Delete, moving handling of EH_FRAME_SECTION_NAME into... (switch_to_eh_frame_section): ...here. Try to set eh_frame_section if it is still null. * except.c (default_exception_section): Delete, moving most of the code to... (switch_to_exception_section): ...this new function. Set exception_section if it is still null, then switch to it. (output_function_exception_table): Use switch_to_exception_section. * varasm.c (exception_section, eh_frame_section): Update comments. (get_section): Hoist use of SECTION_NAMED. (init_varasm_once): Don't set exception_section and eh_frame_section. * output.h (default_exception_section): Delete. (default_eh_frame_section): Delete. testsuite/ * gcc.dg/20051207-1.c, * gcc.dg/20051207-2.c, * gcc.dg/20051207-3.c: New tests. From-SVN: r108336
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 4285d15..244d6d8 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -155,12 +155,14 @@ section *sbss_section;
section *init_section;
section *fini_section;
-/* The section that holds the main exception table. */
+/* The section that holds the main exception table, when known. The section
+ is set either by the target's init_sections hook or by the first call to
+ switch_to_exception_section. */
section *exception_section;
-/* The section that holds the DWARF2 frame unwind information. If it
- is null, we will place the unwind information in the data section
- and emit special labels to guide collect2. */
+/* The section that holds the DWARF2 frame unwind information, when known.
+ The section is set either by the target's init_sections hook or by the
+ first call to switch_to_eh_frame_section. */
section *eh_frame_section;
/* asm_out_file's current section. This is NULL if no section has yet
@@ -230,10 +232,11 @@ get_section (const char *name, unsigned int flags, tree decl)
slot = (section **)
htab_find_slot_with_hash (section_htab, name,
htab_hash_string (name), INSERT);
+ flags |= SECTION_NAMED;
if (*slot == NULL)
{
sect = ggc_alloc (sizeof (struct named_section));
- sect->named.common.flags = flags | SECTION_NAMED;
+ sect->named.common.flags = flags;
sect->named.name = ggc_strdup (name);
sect->named.decl = decl;
*slot = sect;
@@ -241,7 +244,7 @@ get_section (const char *name, unsigned int flags, tree decl)
else
{
sect = *slot;
- if ((sect->common.flags & ~(SECTION_DECLARED | SECTION_NAMED)) != flags
+ if ((sect->common.flags & ~SECTION_DECLARED) != flags
&& ((sect->common.flags | flags) & SECTION_OVERRIDE) == 0)
{
/* Sanity check user variables for flag changes. */
@@ -4868,10 +4871,6 @@ init_varasm_once (void)
if (readonly_data_section == NULL)
readonly_data_section = text_section;
- if (exception_section == NULL)
- exception_section = default_exception_section ();
- if (eh_frame_section == NULL)
- eh_frame_section = default_eh_frame_section ();
}
enum tls_model