From 2ca48caa2c83ba7ba516a227788b2e86f8ca74ec Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Thu, 19 May 2011 14:29:05 +0000 Subject: re PR target/40483 (gcc 4.x needs to utilize better COMDAT mechanism under Solaris) PR target/40483 * configure.ac (gcc_cv_as_comdat_group_group): Check for Sun as COMDAT group syntax, both SPARC and x86 variants. (HAVE_COMDAT_GROUP): Also define if gcc_cv_as_comdat_group_group. * configure: Regenerate. * config/sol2.h (TARGET_SOLARIS): Define. (PUSHSECTION_FORMAT): Remove. (SECTION_NAME_FORMAT): Define. * config/sol2.c: Include hashtab.h. (solaris_output_init_fini): Replace PUSHSECTION_FORMAT by its expansion, using SECTION_NAME_FORMAT. (solaris_comdat_htab): New variable. (struct comdat_entry): Define. (comdat_hash): New function. (comdat_eq): New function. (solaris_elf_asm_comdat_section): New function. (solaris_define_comdat_signature): New function. (solaris_code_end): New function. * config/sol2-protos.h (solaris_elf_asm_comdat_section): Declare. (solaris_code_end): Declare. * config/t-sol2 (sol2.o): Add $HASHTAB_H dependency. * config/i386/i386.c (ix86_code_end) [TARGET_SOLARIS]: Call solaris_code_end. (i386_solaris_elf_named_section): Wrap in TARGET_SOLARIS. Remove ATTRIBUTE_UNUSED. [!USE_GAS]: Call solaris_elf_asm_comdat_section for SECTION_LINKONCE sections if HAVE_COMDAT_GROUP. * config/sparc/sparc.c (sparc_solaris_elf_asm_named_section): Likewise. * config/i386/sol2-10.h (TARGET_ASM_NAMED_SECTION): Moved ... * config/i386/sol2.h (TARGET_ASM_NAMED_SECTION): ... here. * config/sparc/sol2.h (TARGET_ASM_CODE_END): Redefine. (PUSHSECTION_FORMAT): Remove. (SECTION_NAME_FORMAT): Redefine. From-SVN: r173913 --- gcc/config/sol2.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/config/sol2.h') diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 7e42ddb..f3394fd 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -19,6 +19,9 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +/* We are compiling for Solaris 2 now. */ +#define TARGET_SOLARIS 1 + /* We use stabs-in-elf for debugging, because that is what the native toolchain uses. */ #undef PREFERRED_DEBUGGING_TYPE @@ -257,9 +260,8 @@ __enable_execute_stack (void *addr) \ { "init", 0, 0, true, false, false, NULL, false }, \ { "fini", 0, 0, true, false, false, NULL, false } -/* Solaris/x86 as and gas support the common ELF .section/.pushsection - syntax. */ -#define PUSHSECTION_FORMAT "\t.pushsection\t%s\n" +/* Solaris/x86 as and gas support unquoted section names. */ +#define SECTION_NAME_FORMAT "%s" /* This is how to declare the size of a function. For Solaris, we output any .init or .fini entries here. */ -- cgit v1.1