aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-09-15 17:03:22 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-09-15 17:03:22 +0000
commitc18a5b6cadf88275078d4b72249c8174cf079041 (patch)
tree1bbafdfb7e81c8d5ce2b22d7551232d4de285de5 /gcc/config
parentf13ab1ee140dbb6bb9d3bf490468d472efe51659 (diff)
downloadgcc-c18a5b6cadf88275078d4b72249c8174cf079041.zip
gcc-c18a5b6cadf88275078d4b72249c8174cf079041.tar.gz
gcc-c18a5b6cadf88275078d4b72249c8174cf079041.tar.bz2
configure.ac: Check for COMDAT support.
* configure.ac: Check for COMDAT support. Robustify check for SHF_MERGE support. * configure: Regenerated. * config.in: Likewise. * langhooks-def.h (lhd_comdat_group): New function. (LANG_HOOKS_COMDAT_GROUP): New macro. (LANG_HOOKS_DECLS): Use it. * langhooks.c (lhd_comdat_group): Define. * langhooks.h (lang_hooks_for_decls): Add comdat_group. * output.h (named_section_flags): Make it a macro. (named_section_real): New function. (default_no_named_section): Add decl parameter. (default_elf_asm_named_section): Likewise. (default_coff_asm_named_section): Likewise. (default_pe_asm_named_section): Likewise. * target.h (gcc_target): Adjust type of named_section. * varasm.c (named_section_flags): Rename to named_section_real. Add decl parameter. (default_no_named_section): Add decl parameter. (default_elf_asm_named_section): Use COMDAT, if available. Deal with the case that ASM_COMMENT_START is "@". (default_coff_asm_named_section): Add decl parameter. (default_pe_asm_named_section): Likewise. * config/alpha/alpha.c (vms_asm_named_section): Add decl parameter. (unicosmk_asm_named_section): Likewise. * config/arm/arm.c (arm_elf_asm_named_section): Remove. * config/arm/elf.h (TARGET_ASM_NAMED_SECTION): Likewise. * config/c4x/c4x.c (c4x_asm_named_section): Add decl parameter. * config/cris/cris-protos.h (cris_target_asm_named_section): Likewise. * config/cris/cris.c (cris_target_asm_named_section): Likewise. * config/h8300/h8300.c (h8300_asm_named_section): Likewise. * config/i386/i386-protos.h (i386_pe_asm_named_section): Likewise. * config/i386/winnt.c (i386_pe_asm_named_section): Likewise. * config/m68k/m68k.c (m68k_coff_asm_named_section): Likewise. * config/mcore/mcore.c (mcore_asm_named_section): Likewise. * config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section): Likewise. * config/sparc/sparc.c (sparce_elf_asm_named_section): Likewise. * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define. * cp-tree.h (cxx_comdat_group): Declare. * decl.c (cxx_comdat_group): New function. From-SVN: r87557
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c6
-rw-r--r--gcc/config/arm/arm.c59
-rw-r--r--gcc/config/arm/elf.h3
-rw-r--r--gcc/config/c4x/c4x.c5
-rw-r--r--gcc/config/cris/cris-protos.h2
-rw-r--r--gcc/config/cris/cris.c7
-rw-r--r--gcc/config/darwin-protos.h2
-rw-r--r--gcc/config/darwin.c4
-rw-r--r--gcc/config/h8300/h8300.c5
-rw-r--r--gcc/config/i386/i386-protos.h2
-rw-r--r--gcc/config/i386/winnt.c3
-rw-r--r--gcc/config/m68k/m68k.c5
-rw-r--r--gcc/config/mcore/mcore.c6
-rw-r--r--gcc/config/rs6000/rs6000.c3
-rw-r--r--gcc/config/sparc/sparc.c7
15 files changed, 35 insertions, 84 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 54d78f6..21aa382 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -8455,7 +8455,8 @@ vms_section_type_flags (tree decl, const char *name, int reloc)
the section; 0 if the default should be used. */
static void
-vms_asm_named_section (const char *name, unsigned int flags)
+vms_asm_named_section (const char *name, unsigned int flags,
+ tree decl ATTRIBUTE_UNUSED)
{
fputc ('\n', asm_out_file);
fprintf (asm_out_file, ".section\t%s", name);
@@ -8679,7 +8680,8 @@ unicosmk_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
the section; 0 if the default should be used. */
static void
-unicosmk_asm_named_section (const char *name, unsigned int flags)
+unicosmk_asm_named_section (const char *name, unsigned int flags,
+ tree decl ATTRIBUTE_UNUSED)
{
const char *kind;
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e7ed075..ee334df 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -145,9 +145,6 @@ static rtx arm_expand_unop_builtin (enum insn_code, tree, rtx, int);
static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void emit_constant_insn (rtx cond, rtx pattern);
-#ifdef OBJECT_FORMAT_ELF
-static void arm_elf_asm_named_section (const char *, unsigned int);
-#endif
#ifndef ARM_PE
static void arm_encode_section_info (tree, rtx, int);
#endif
@@ -13771,62 +13768,6 @@ aof_file_end (void)
}
#endif /* AOF_ASSEMBLER */
-#ifdef OBJECT_FORMAT_ELF
-/* Switch to an arbitrary section NAME with attributes as specified
- by FLAGS. ALIGN specifies any known alignment requirements for
- the section; 0 if the default should be used.
-
- Differs from the default elf version only in the prefix character
- used before the section type. */
-
-static void
-arm_elf_asm_named_section (const char *name, unsigned int flags)
-{
- char flagchars[10], *f = flagchars;
-
- if (! named_section_first_declaration (name))
- {
- fprintf (asm_out_file, "\t.section\t%s\n", name);
- return;
- }
-
- if (!(flags & SECTION_DEBUG))
- *f++ = 'a';
- if (flags & SECTION_WRITE)
- *f++ = 'w';
- if (flags & SECTION_CODE)
- *f++ = 'x';
- if (flags & SECTION_SMALL)
- *f++ = 's';
- if (flags & SECTION_MERGE)
- *f++ = 'M';
- if (flags & SECTION_STRINGS)
- *f++ = 'S';
- if (flags & SECTION_TLS)
- *f++ = 'T';
- *f = '\0';
-
- fprintf (asm_out_file, "\t.section\t%s,\"%s\"", name, flagchars);
-
- if (!(flags & SECTION_NOTYPE))
- {
- const char *type;
-
- if (flags & SECTION_BSS)
- type = "nobits";
- else
- type = "progbits";
-
- fprintf (asm_out_file, ",%%%s", type);
-
- if (flags & SECTION_ENTSIZE)
- fprintf (asm_out_file, ",%d", flags & SECTION_ENTSIZE);
- }
-
- putc ('\n', asm_out_file);
-}
-#endif
-
#ifndef ARM_PE
/* Symbols in the text segment can be accessed without indirecting via the
constant pool; it may take an extra binary operation, but this is still
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
index dae8acd..1275956 100644
--- a/gcc/config/arm/elf.h
+++ b/gcc/config/arm/elf.h
@@ -119,9 +119,6 @@
#define TARGET_ASM_FILE_START_APP_OFF true
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
-#undef TARGET_ASM_NAMED_SECTION
-#define TARGET_ASM_NAMED_SECTION arm_elf_asm_named_section
-
/* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */
#define NEED_PLT_RELOC flag_pic
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 5437568..2d6e660 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -195,7 +195,7 @@ static int c4x_label_ref_used_p (rtx, rtx);
static tree c4x_handle_fntype_attribute (tree *, tree, tree, int, bool *);
const struct attribute_spec c4x_attribute_table[];
static void c4x_insert_attributes (tree, tree *);
-static void c4x_asm_named_section (const char *, unsigned int);
+static void c4x_asm_named_section (const char *, unsigned int, tree);
static int c4x_adjust_cost (rtx, rtx, rtx, int);
static void c4x_globalize_label (FILE *, const char *);
static bool c4x_rtx_costs (rtx, int, int, int *);
@@ -4924,7 +4924,8 @@ c4x_init_libfuncs (void)
}
static void
-c4x_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
+c4x_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED,
+ tree decl ATTRIBUTE_UNUSED)
{
fprintf (asm_out_file, "\t.sect\t\"%s\"\n", name);
}
diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h
index 15e91df..f085e5d 100644
--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -44,8 +44,8 @@ extern int cris_got_symbol (rtx);
extern int cris_symbol (rtx);
extern void cris_output_addr_const (FILE *, rtx);
extern int cris_cfun_uses_pic_table (void);
-extern void cris_target_asm_named_section (const char *, unsigned int);
#endif /* RTX_CODE */
+extern void cris_target_asm_named_section (const char *, unsigned int, tree);
extern int cris_return_address_on_stack (void);
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 468859f..2021c71 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -2450,12 +2450,13 @@ cris_reg_overlap_mentioned_p (rtx x, rtx in)
We just dispatch to the functions for ELF and a.out. */
void
-cris_target_asm_named_section (const char *name, unsigned int flags)
+cris_target_asm_named_section (const char *name, unsigned int flags,
+ tree decl)
{
if (! TARGET_ELF)
- default_no_named_section (name, flags);
+ default_no_named_section (name, flags, decl);
else
- default_elf_asm_named_section (name, flags);
+ default_elf_asm_named_section (name, flags, decl);
}
/* The LEGITIMATE_PIC_OPERAND_P worker. */
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index a5ae08e..402311c 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -69,7 +69,7 @@ extern void machopic_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
extern void darwin_unique_section (tree decl, int reloc);
-extern void darwin_asm_named_section (const char *, unsigned int);
+extern void darwin_asm_named_section (const char *, unsigned int, tree);
extern unsigned int darwin_section_type_flags (tree, const char *, int);
extern void darwin_non_lazy_pcrel (FILE *, rtx);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 6bab554..249ebab 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1187,7 +1187,9 @@ darwin_globalize_label (FILE *stream, const char *name)
}
void
-darwin_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
+darwin_asm_named_section (const char *name,
+ unsigned int flags ATTRIBUTE_UNUSED,
+ tree decl ATTRIBUTE_UNUSED)
{
fprintf (asm_out_file, ".section %s\n", name);
}
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 6cec395..564eecd 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -114,7 +114,7 @@ static tree h8300_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
static tree h8300_handle_eightbit_data_attribute (tree *, tree, tree, int, bool *);
static tree h8300_handle_tiny_data_attribute (tree *, tree, tree, int, bool *);
#ifndef OBJECT_FORMAT_ELF
-static void h8300_asm_named_section (const char *, unsigned int);
+static void h8300_asm_named_section (const char *, unsigned int, tree);
#endif
static int h8300_and_costs (rtx);
static int h8300_shift_costs (rtx);
@@ -5889,7 +5889,8 @@ h8300_reorg (void)
#ifndef OBJECT_FORMAT_ELF
static void
-h8300_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
+h8300_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED,
+ tree decl)
{
/* ??? Perhaps we should be using default_coff_asm_named_section. */
fprintf (asm_out_file, "\t.section %s\n", name);
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 1c87da6..d663b09 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -206,7 +206,7 @@ extern int ix86_constant_alignment (tree, int);
extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *);
extern unsigned int i386_pe_section_type_flags (tree, const char *, int);
-extern void i386_pe_asm_named_section (const char *, unsigned int);
+extern void i386_pe_asm_named_section (const char *, unsigned int, tree);
extern int x86_field_alignment (tree, int);
#endif
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 7e32ca9..676a34a 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -622,7 +622,8 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc)
}
void
-i386_pe_asm_named_section (const char *name, unsigned int flags)
+i386_pe_asm_named_section (const char *name, unsigned int flags,
+ tree decl ATTRIBUTE_UNUSED)
{
char flagchars[8], *f = flagchars;
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index dd469c3..d85c7c6 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -108,7 +108,7 @@ static const char *singlemove_string (rtx *);
static void m68k_output_function_prologue (FILE *, HOST_WIDE_INT);
static void m68k_output_function_epilogue (FILE *, HOST_WIDE_INT);
#ifdef M68K_TARGET_COFF
-static void m68k_coff_asm_named_section (const char *, unsigned int);
+static void m68k_coff_asm_named_section (const char *, unsigned int, tree);
#endif /* M68K_TARGET_COFF */
static void m68k_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
@@ -3324,7 +3324,8 @@ output_xorsi3 (rtx *operands)
/* Output assembly to switch to section NAME with attribute FLAGS. */
static void
-m68k_coff_asm_named_section (const char *name, unsigned int flags)
+m68k_coff_asm_named_section (const char *name, unsigned int flags,
+ tree decl ATTRIBUTE_UNUSED)
{
char flagchar;
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index d121848..bdcbde9 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -138,7 +138,7 @@ const struct attribute_spec mcore_attribute_table[];
static tree mcore_handle_naked_attribute (tree *, tree, tree, int, bool *);
#ifdef OBJECT_FORMAT_ELF
static void mcore_asm_named_section (const char *,
- unsigned int);
+ unsigned int, tree);
#endif
static void mcore_unique_section (tree, int);
static void mcore_encode_section_info (tree, rtx, int);
@@ -3424,7 +3424,9 @@ mcore_naked_function_p (void)
#ifdef OBJECT_FORMAT_ELF
static void
-mcore_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
+mcore_asm_named_section (const char *name,
+ unsigned int flags ATTRIBUTE_UNUSED,
+ tree decl ATTRIBUTE_UNUSED)
{
fprintf (asm_out_file, "\t.section %s\n", name);
}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index b47ccf0..322a786 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -16932,7 +16932,8 @@ rs6000_xcoff_asm_globalize_label (FILE *stream, const char *name)
}
static void
-rs6000_xcoff_asm_named_section (const char *name, unsigned int flags)
+rs6000_xcoff_asm_named_section (const char *name, unsigned int flags,
+ tree decl ATTRIBUTE_UNUSED)
{
int smclass;
static const char * const suffix[3] = { "PR", "RO", "RW" };
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index dd441ba..63d3f01 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -304,7 +304,7 @@ static void emit_restore_regs (void);
static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT);
static void sparc_asm_function_epilogue (FILE *, HOST_WIDE_INT);
#ifdef OBJECT_FORMAT_ELF
-static void sparc_elf_asm_named_section (const char *, unsigned int);
+static void sparc_elf_asm_named_section (const char *, unsigned int, tree);
#endif
static int sparc_adjust_cost (rtx, rtx, rtx, int);
@@ -8060,13 +8060,14 @@ sparc_profile_hook (int labelno)
#ifdef OBJECT_FORMAT_ELF
static void
-sparc_elf_asm_named_section (const char *name, unsigned int flags)
+sparc_elf_asm_named_section (const char *name, unsigned int flags,
+ tree decl)
{
if (flags & SECTION_MERGE)
{
/* entsize cannot be expressed in this section attributes
encoding style. */
- default_elf_asm_named_section (name, flags);
+ default_elf_asm_named_section (name, flags, decl);
return;
}