diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8723bcbf59f..05801cd8f50 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2003-07-14 Richard Sandiford + * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Use + mips_output_aligned_bss. + * config/mips/linux.h: Likewise. + * config/mips/mips-protos.h (mips_output_aligned_bss): Declare. + * config/mips/mips.c (mips_output_aligned_bss): New function. + * config/mips/elf.h (DBX_DEBUGGING_INFO): Delete. * config/mips/elf64.h: Likewise. diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h index 20861f91ee5..61999e2c372 100644 --- a/gcc/config/mips/elf.h +++ b/gcc/config/mips/elf.h @@ -71,26 +71,8 @@ Boston, MA 02111-1307, USA. */ #define BSS_SECTION_ASM_OP "\t.section\t.bss" #endif -/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a - separate, explicit argument. If you define this macro, it is used - in place of `ASM_OUTPUT_BSS', and gives you more flexibility in - handling the required alignment of the variable. The alignment is - specified as the number of bits. - - Try to use function `asm_output_aligned_bss' defined in file - `varasm.c' when defining this macro. */ #ifndef ASM_OUTPUT_ALIGNED_BSS -#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -do { \ - if (SIZE > 0 && SIZE <= (unsigned HOST_WIDE_INT)mips_section_threshold)\ - named_section (0, ".sbss", 0); \ - else \ - bss_section (); \ - ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \ - last_assemble_variable_decl = DECL; \ - ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \ - ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \ -} while (0) +#define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss #endif #undef ASM_DECLARE_OBJECT_NAME diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index e7c9afd07e7..70acf11ee99 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -34,25 +34,7 @@ Boston, MA 02111-1307, USA. */ used. */ #define BSS_SECTION_ASM_OP "\t.section\t.bss" -/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a - separate, explicit argument. If you define this macro, it is used - in place of `ASM_OUTPUT_BSS', and gives you more flexibility in - handling the required alignment of the variable. The alignment is - specified as the number of bits. - - Try to use function `asm_output_aligned_bss' defined in file - `varasm.c' when defining this macro. */ -#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -do { \ - if (SIZE > 0 && (long)(SIZE) <= mips_section_threshold) \ - named_section (0, ".sbss", 0); \ - else \ - bss_section (); \ - ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \ - last_assemble_variable_decl = DECL; \ - ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \ - ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \ -} while (0) +#define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss #undef ASM_DECLARE_OBJECT_NAME #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index d60c7c72705..4185fda1763 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -39,6 +39,9 @@ extern void mips_declare_object_name PARAMS ((FILE *, const char *, tree)); extern void mips_finish_declare_object PARAMS ((FILE *, tree, int, int)); +extern void mips_output_aligned_bss + PARAMS ((FILE *, tree, const char *, + unsigned HOST_WIDE_INT, int)); extern void mips_expand_epilogue PARAMS ((int)); extern void mips_expand_prologue PARAMS ((void)); extern void mips_output_filename PARAMS ((FILE *, const char *)); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index b7b9b7b56c2..037e88707b3 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -6175,6 +6175,31 @@ mips_file_start () ASM_COMMENT_START, mips_section_threshold, mips_arch_info->name, mips_isa); } + +#ifdef BSS_SECTION_ASM_OP +/* Implement ASM_OUTPUT_ALIGNED_BSS. This differs from the default only + in the use of sbss. */ + +void +mips_output_aligned_bss (stream, decl, name, size, align) + FILE *stream; + tree decl; + const char *name; + unsigned HOST_WIDE_INT size; + int align; +{ + extern tree last_assemble_variable_decl; + + if (mips_in_small_data_p (decl)) + named_section (0, ".sbss", 0); + else + bss_section (); + ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT)); + last_assemble_variable_decl = decl; + ASM_DECLARE_OBJECT_NAME (stream, name, decl); + ASM_OUTPUT_SKIP (stream, size != 0 ? size : 1); +} +#endif /* If we are optimizing the global pointer, emit the text section now and any small externs which did not have .comm, etc that are needed. Also, give a