From 64717bc586320bd9d267b2c8bc8a32b991e0dd34 Mon Sep 17 00:00:00 2001 From: amodra Date: Tue, 11 Jan 2005 04:07:28 +0000 Subject: [PATCH] * varasm.c (default_section_type_flags_1): Don't set SECTION_SMALL. * config/ia64/ia64.c (TARGET_SECTION_TYPE_FLAGS): Define. (TARGET_RWRELOC): Define. (ia64_rwreloc_section_type_flags): Delete. (ia64_section_type_flags): New function. * config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): Don't define. (TARGET_RWRELOC): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93175 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/ia64/hpux.h | 5 ++--- gcc/config/ia64/ia64.c | 32 +++++++++++++++++++++++++------- gcc/varasm.c | 18 +++++------------- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1db3edd0895..205c7b8917c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2005-01-11 Alan Modra + + * varasm.c (default_section_type_flags_1): Don't set SECTION_SMALL. + * config/ia64/ia64.c (TARGET_SECTION_TYPE_FLAGS): Define. + (TARGET_RWRELOC): Define. + (ia64_rwreloc_section_type_flags): Delete. + (ia64_section_type_flags): New function. + * config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): Don't define. + (TARGET_RWRELOC): Define. + 2005-01-10 David Mosberger PR target/18987 diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h index cd65be5d688..9ae420f84fc 100644 --- a/gcc/config/ia64/hpux.h +++ b/gcc/config/ia64/hpux.h @@ -1,5 +1,5 @@ /* Definitions of target machine GNU compiler. IA-64 version. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Ellcey and Reva Cuthbertson @@ -193,8 +193,7 @@ do { \ #define TARGET_ASM_UNIQUE_SECTION ia64_rwreloc_unique_section #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION ia64_rwreloc_select_rtx_section -#undef TARGET_SECTION_TYPE_FLAGS -#define TARGET_SECTION_TYPE_FLAGS ia64_rwreloc_section_type_flags +#define TARGET_RWRELOC true /* ia64 HPUX has the float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 5e8c5cd9970..11f47511947 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by James E. Wilson and David Mosberger . @@ -258,9 +258,7 @@ static void ia64_rwreloc_unique_section (tree, int) static void ia64_rwreloc_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT) ATTRIBUTE_UNUSED; -static unsigned int ia64_rwreloc_section_type_flags (tree, const char *, int) - ATTRIBUTE_UNUSED; - +static unsigned int ia64_section_type_flags (tree, const char *, int); static void ia64_hpux_add_extern_decl (tree decl) ATTRIBUTE_UNUSED; static void ia64_hpux_file_end (void) @@ -387,6 +385,9 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS ia64_section_type_flags + /* ??? ABI doesn't allow us to define this. */ #if 0 #undef TARGET_PROMOTE_FUNCTION_ARGS @@ -8796,10 +8797,27 @@ ia64_rwreloc_select_rtx_section (enum machine_mode mode, rtx x, flag_pic = save_pic; } +#ifndef TARGET_RWRELOC +#define TARGET_RWRELOC flag_pic +#endif + static unsigned int -ia64_rwreloc_section_type_flags (tree decl, const char *name, int reloc) -{ - return default_section_type_flags_1 (decl, name, reloc, true); +ia64_section_type_flags (tree decl, const char *name, int reloc) +{ + unsigned int flags = 0; + + if (strcmp (name, ".sdata") == 0 + || strncmp (name, ".sdata.", 7) == 0 + || strncmp (name, ".gnu.linkonce.s.", 16) == 0 + || strncmp (name, ".sdata2.", 8) == 0 + || strncmp (name, ".gnu.linkonce.s2.", 17) == 0 + || strcmp (name, ".sbss") == 0 + || strncmp (name, ".sbss.", 6) == 0 + || strncmp (name, ".gnu.linkonce.sb.", 17) == 0) + flags = SECTION_SMALL; + + flags |= default_section_type_flags_1 (decl, name, reloc, TARGET_RWRELOC); + return flags; } /* Returns true if FNTYPE (a FUNCTION_TYPE or a METHOD_TYPE) returns a diff --git a/gcc/varasm.c b/gcc/varasm.c index 086e9cc001b..ba0aab553ed 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1,6 +1,7 @@ /* Output variables, constants and external declarations, for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -4606,20 +4607,11 @@ default_section_type_flags_1 (tree decl, const char *name, int reloc, if (strcmp (name, ".bss") == 0 || strncmp (name, ".bss.", 5) == 0 - || strncmp (name, ".gnu.linkonce.b.", 16) == 0) - flags |= SECTION_BSS; - - if (strcmp (name, ".sdata") == 0 - || strncmp (name, ".sdata.", 7) == 0 - || strncmp (name, ".gnu.linkonce.s.", 16) == 0 - || strncmp (name, ".sdata2.", 8) == 0 - || strncmp (name, ".gnu.linkonce.s2.", 17) == 0) - flags |= SECTION_SMALL; - - if (strcmp (name, ".sbss") == 0 + || strncmp (name, ".gnu.linkonce.b.", 16) == 0 + || strcmp (name, ".sbss") == 0 || strncmp (name, ".sbss.", 6) == 0 || strncmp (name, ".gnu.linkonce.sb.", 17) == 0) - flags |= SECTION_SMALL | SECTION_BSS; + flags |= SECTION_BSS; if (strcmp (name, ".tdata") == 0 || strncmp (name, ".tdata.", 7) == 0 -- 2.11.0