elf.h (ASM_OUTPUT_ALIGNED_BSS): Use mips_output_aligned_bss.

* 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.

From-SVN: r69355
This commit is contained in:
Richard Sandiford 2003-07-14 20:29:34 +00:00 committed by Richard Sandiford
parent 8d50bd1960
commit 6d0b50a4c8
5 changed files with 36 additions and 38 deletions

View File

@ -1,5 +1,11 @@
2003-07-14 Richard Sandiford <rsandifo@redhat.com>
* 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.

View File

@ -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

View File

@ -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

View File

@ -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 *));

View File

@ -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