aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2003-07-14 20:29:34 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2003-07-14 20:29:34 +0000
commit6d0b50a4c8b4078d221e83ecba286271623dc6b8 (patch)
tree9f96681335dd0d10dbc40455f3aa085de12537a6 /gcc
parent8d50bd1960c12c8f10703221c80f0e91a36dfebf (diff)
downloadgcc-6d0b50a4c8b4078d221e83ecba286271623dc6b8.zip
gcc-6d0b50a4c8b4078d221e83ecba286271623dc6b8.tar.gz
gcc-6d0b50a4c8b4078d221e83ecba286271623dc6b8.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/elf.h20
-rw-r--r--gcc/config/mips/linux.h20
-rw-r--r--gcc/config/mips/mips-protos.h3
-rw-r--r--gcc/config/mips/mips.c25
5 files changed, 36 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8723bcb..05801cd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index 20861f9..61999e2 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 e7c9afd..70acf11 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 d60c7c7..4185fda 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 b7b9b7b..037e887 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