This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to clean up mips header files
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: echristo at redhat dot com
- Date: 13 Jul 2003 19:44:47 +0100
- Subject: Patch to clean up mips header files
This patch is an attempt to clean up the mips header files. It isn't
very ambitious, mostly because I wanted to keep the same output for every
configuration. We could clean things up a bit more if we accept "innocent"
changes in output.
To test the patch, I built a C compiler for each of the following:
mips64-elf mips64-linux-gnu mips64orion-elf mips64vr-elf
mips-elf mipsel-openbsd mipsisa32-elf mipsisa64-elf
mipsisa64sr71k-elf mips-linux-gnu mips-netbsd mips-openbsd
mips-rtems mips-sgi-irix5 mips-sgi-irix5cross64
mips-sgi-irix6.5 mips-sgi-irix6.5o32 mipstx39-elf
in each case with and without --with-gnu-as. There were no changes
in the assembler output for gcc-c.torture when compiled with -O2 -g.
Diffs of the build logs shows no new warnings.
Bootstrapped & tested on mips-sgi-irix6.5, also tested on mips64vrel-elf.
Ok to install?
Richard
[Although the patch was tested as a whole, I thought it'd be easier
to explain (& review?) in bits.]
Part 1
------
This part just moves the sdb support to a separate header. No configuration
uses sdb as its default debug format but:
- mips-sgi-irix6*o32 (--with-gnu-as)
- mips-sgi-irix5* (--with-gnu-as)
- mips*-openbsd
still support it as an alternative. Dunno whether the openbsd case
is intentional.
* config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Add mips/sdb.h
to the list of include files when using gas.
(mips*el-*-openbsd*, mips*-*-openbsd*): Add mips/sdb.h unconditionally.
* config/mips/elf.h: Remove #undef SDB_DEBUGGING_INFO.
* config/mips/elf64.h: Likewise.
* config/mips/iris5.h: Likewise.
* config/mips/linux.h: Likewise.
* config/mips/iris5gas.h (SDB_DEBUGGING_INFO): Remove definition.
* config/mips/mips.h (PREFERRED_DEBUGGING_TYPE): Likewise.
(SDB_DEBUGGING_INFO, sdb*, SDB_ALLOW_*, PUT_SDB*): Move to...
* config/mips/sdb.h: ...this new file.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.333
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.333 config.gcc
--- config.gcc 10 Jul 2003 04:50:15 -0000 1.333
+++ config.gcc 13 Jul 2003 10:48:19 -0000
@@ -1397,7 +1397,7 @@ mips-sgi-irix6*o32) # SGI System V.4.,
tm_file="${tm_file} mips/iris5.h"
if test x$gas = xyes
then
- tm_file="${tm_file} mips/iris5gas.h mips/iris6-o32-gas.h"
+ tm_file="${tm_file} mips/sdb.h mips/iris5gas.h mips/iris6-o32-gas.h"
if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
@@ -1447,7 +1447,7 @@ mips-sgi-irix5*) # SGI System V.4., IRI
tm_file="${tm_file} mips/iris5.h"
if test x$gas = xyes
then
- tm_file="${tm_file} mips/iris5gas.h"
+ tm_file="${tm_file} mips/sdb.h mips/iris5gas.h"
if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
@@ -1501,10 +1501,11 @@ mips*-*-linux*) # Linux MIPS, either
;;
mips*el-*-openbsd*) # mips little endian
target_cpu_default="MASK_GAS|MASK_ABICALLS"
+ tm_file="${tm_file} mips/sdb.h"
;;
mips*-*-openbsd*) # mips big endian
target_cpu_default="MASK_GAS|MASK_ABICALLS"
- tm_file="mips/openbsd-be.h ${tm_file}"
+ tm_file="mips/openbsd-be.h ${tm_file} mips/sdb.h"
;;
mipsisa32-*-elf* | mipsisa32el-*-elf*)
tm_file="${tm_file} mips/elf.h"
Index: config/mips/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf.h,v
retrieving revision 1.52
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.52 elf.h
--- config/mips/elf.h 8 Jul 2003 17:36:00 -0000 1.52
+++ config/mips/elf.h 13 Jul 2003 10:48:19 -0000
@@ -24,9 +24,6 @@ Boston, MA 02111-1307, USA. */
#undef OBJECT_FORMAT_COFF
#undef EXTENDED_COFF
-/* ??? Move all SDB stuff into separate header file. */
-#undef SDB_DEBUGGING_INFO
-
#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
Index: config/mips/elf64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf64.h,v
retrieving revision 1.56
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.56 elf64.h
--- config/mips/elf64.h 8 Jul 2003 17:36:00 -0000 1.56
+++ config/mips/elf64.h 13 Jul 2003 10:48:19 -0000
@@ -23,7 +23,6 @@ Boston, MA 02111-1307, USA. */
#undef OBJECT_FORMAT_COFF
#undef EXTENDED_COFF
-#undef SDB_DEBUGGING_INFO
#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
Index: config/mips/iris5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5.h,v
retrieving revision 1.18
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.18 iris5.h
--- config/mips/iris5.h 2 Jul 2003 00:21:55 -0000 1.18
+++ config/mips/iris5.h 13 Jul 2003 10:48:19 -0000
@@ -140,7 +140,6 @@ #define NO_IMPLICIT_EXTERN_C 1
/* We don't support debugging info for now. */
#undef DBX_DEBUGGING_INFO
-#undef SDB_DEBUGGING_INFO
#undef MIPS_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
Index: config/mips/iris5gas.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5gas.h,v
retrieving revision 1.13
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.13 iris5gas.h
--- config/mips/iris5gas.h 11 Jun 2003 16:19:16 -0000 1.13
+++ config/mips/iris5gas.h 13 Jul 2003 10:48:19 -0000
@@ -3,7 +3,6 @@
/* Enable debugging. */
#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
-#define SDB_DEBUGGING_INFO 1
#define MIPS_DEBUGGING_INFO 1
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
Index: config/mips/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
retrieving revision 1.61
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.61 linux.h
--- config/mips/linux.h 8 Jul 2003 17:36:01 -0000 1.61
+++ config/mips/linux.h 13 Jul 2003 10:48:19 -0000
@@ -226,10 +226,6 @@ #define ASM_PREFERRED_EH_DATA_FORMAT(COD
#undef ASM_OUTPUT_REG_PUSH
#undef ASM_OUTPUT_REG_POP
-/* The current Linux binutils uses MIPS_STABS_ELF and doesn't support
- COFF. */
-#undef SDB_DEBUGGING_INFO
-
#undef LIB_SPEC
#define LIB_SPEC "\
%{shared: -lc} \
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.273
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.273 mips.h
--- config/mips/mips.h 8 Jul 2003 17:36:01 -0000 1.273
+++ config/mips/mips.h 13 Jul 2003 10:48:24 -0000
@@ -117,8 +117,6 @@ extern int num_source_filenames; /* curr
extern int inside_function; /* != 0 if inside of a function */
extern int ignore_line_number; /* != 0 if we are to ignore next .loc */
extern int file_in_function_warning; /* warning given about .file in func */
-extern int sdb_label_count; /* block start/end next label # */
-extern int sdb_begin_function_line; /* Starting Line of current function */
extern int mips_section_threshold; /* # bytes of data/sdata cutoff */
extern int sym_lineno; /* sgi next label # for each stmt */
extern int set_noreorder; /* # of nested .set noreorder's */
@@ -1257,14 +1255,9 @@ #define TARGET_VERSION TARGET_VERSION_IN
#endif
-#define SDB_DEBUGGING_INFO 1 /* generate info for mips-tfile */
#define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */
#define MIPS_DEBUGGING_INFO 1 /* MIPS specific debugging info */
-#ifndef PREFERRED_DEBUGGING_TYPE /* assume SDB_DEBUGGING_INFO */
-#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
-#endif
-
/* By default, turn on GDB extensions. */
#define DEFAULT_GDB_EXTENSIONS 1
@@ -1292,12 +1285,6 @@ #define LOCAL_LABEL_PREFIX "$"
#define USER_LABEL_PREFIX ""
#endif
-/* Forward references to tags are allowed. */
-#define SDB_ALLOW_FORWARD_REFERENCES
-
-/* Unknown tags are also allowed. */
-#define SDB_ALLOW_UNKNOWN_REFERENCES
-
/* On Sun 4, this limit is 2048. We use 1500 to be safe,
since the length can run past this up to a continuation point. */
#undef DBX_CONTIN_LENGTH
@@ -1329,60 +1316,6 @@ #define EH_RETURN_STACKADJ_RTX gen_rtx_
#define DWARF_CIE_DATA_ALIGNMENT 4
#define FIND_BASE_TERM(X) mips_delegitimize_address (X)
-
-#define PUT_SDB_DEF(a) \
-do { \
- fprintf (asm_out_file, "\t%s.def\t", \
- (TARGET_GAS) ? "" : "#"); \
- ASM_OUTPUT_LABELREF (asm_out_file, a); \
- fputc (';', asm_out_file); \
-} while (0)
-
-#define PUT_SDB_PLAIN_DEF(a) \
-do { \
- fprintf (asm_out_file, "\t%s.def\t.%s;", \
- (TARGET_GAS) ? "" : "#", (a)); \
-} while (0)
-
-/* For block start and end, we create labels, so that
- later we can figure out where the correct offset is.
- The normal .ent/.end serve well enough for functions,
- so those are just commented out. */
-
-#define PUT_SDB_BLOCK_START(LINE) \
-do { \
- fprintf (asm_out_file, \
- "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (TARGET_GAS) ? "" : "#", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (LINE)); \
- sdb_label_count++; \
-} while (0)
-
-#define PUT_SDB_BLOCK_END(LINE) \
-do { \
- fprintf (asm_out_file, \
- "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (TARGET_GAS) ? "" : "#", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (LINE)); \
- sdb_label_count++; \
-} while (0)
-
-#define PUT_SDB_FUNCTION_START(LINE)
-
-#define PUT_SDB_FUNCTION_END(LINE) \
-do { \
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \
-} while (0)
-
-#define PUT_SDB_EPILOGUE_END(NAME)
/* Correct the offset of automatic variables and arguments. Note that
the MIPS debug format wants all automatic variables and arguments
--- /dev/null Tue Jun 17 23:06:41 2003
+++ config/mips/sdb.h Sun Jul 13 11:57:33 2003
@@ -0,0 +1,89 @@
+/* Generate SDB debugging info.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+/* Note that no configuration uses sdb as its preferred format. */
+
+#define SDB_DEBUGGING_INFO 1
+
+/* Forward references to tags are allowed. */
+#define SDB_ALLOW_FORWARD_REFERENCES
+
+/* Unknown tags are also allowed. */
+#define SDB_ALLOW_UNKNOWN_REFERENCES
+
+/* Block start/end next label #. */
+extern int sdb_label_count;
+
+/* Starting line of current function. */
+extern int sdb_begin_function_line;
+
+#define PUT_SDB_DEF(a) \
+do { \
+ fprintf (asm_out_file, "\t%s.def\t", \
+ (TARGET_GAS) ? "" : "#"); \
+ ASM_OUTPUT_LABELREF (asm_out_file, a); \
+ fputc (';', asm_out_file); \
+} while (0)
+
+#define PUT_SDB_PLAIN_DEF(a) \
+do { \
+ fprintf (asm_out_file, "\t%s.def\t.%s;", \
+ (TARGET_GAS) ? "" : "#", (a)); \
+} while (0)
+
+/* For block start and end, we create labels, so that
+ later we can figure out where the correct offset is.
+ The normal .ent/.end serve well enough for functions,
+ so those are just commented out. */
+
+#define PUT_SDB_BLOCK_START(LINE) \
+do { \
+ fprintf (asm_out_file, \
+ "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (TARGET_GAS) ? "" : "#", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (LINE)); \
+ sdb_label_count++; \
+} while (0)
+
+#define PUT_SDB_BLOCK_END(LINE) \
+do { \
+ fprintf (asm_out_file, \
+ "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (TARGET_GAS) ? "" : "#", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (LINE)); \
+ sdb_label_count++; \
+} while (0)
+
+#define PUT_SDB_FUNCTION_START(LINE)
+
+#define PUT_SDB_FUNCTION_END(LINE) \
+do { \
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \
+} while (0)
+
+#define PUT_SDB_EPILOGUE_END(NAME)
Part 2
------
mips.h still defines OBJECT_FORMAT_COFF and EXTENDED_COFF. Now that
we've got rid of all coff targets (yay!) every configuration will #undef
OBJECT_FORMAT_COFF in one of the other headers. Some also undefine
EXTENDED_COFF but it has no effect without OJBECT_FORMAT_COFF anyway.
We also had some mips-tfile support lying around.
* config/mips/elf.h (OBJECT_FORMAT_COFF, EXTENDED_COFF): Remove undefs.
* config/mips/elf64.h: Likewise.
* config/mips/openbsd.h: Likewise.
* config/mips/iris5.h (OBJECT_FORMAT_COFF): Remove undefs.
* config/mips/linux.h: Likewise.
* config/mips/mips.h (OBJECT_FORMAT_COFF, EXTENDED_COFF): Delete.
(CODE_MASK, MIPS_IS_STAB, MIPS_MARK_STAB, MIPS_UNMARK_STAB): Delete.
diff -updr config/mips.02/elf.h config/mips/elf.h
--- config/mips.02/elf.h Sun Jul 13 11:44:06 2003
+++ config/mips/elf.h Sun Jul 13 11:44:31 2003
@@ -21,9 +21,6 @@ the Free Software Foundation, 59 Temple
Boston, MA 02111-1307, USA. */
/* Use ELF. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
-
#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
diff -updr config/mips.02/elf64.h config/mips/elf64.h
--- config/mips.02/elf64.h Sun Jul 13 11:44:06 2003
+++ config/mips/elf64.h Sun Jul 13 11:44:31 2003
@@ -20,9 +20,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
-
#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
diff -updr config/mips.02/iris5.h config/mips/iris5.h
--- config/mips.02/iris5.h Sun Jul 13 11:44:06 2003
+++ config/mips/iris5.h Sun Jul 13 11:44:31 2003
@@ -23,9 +23,6 @@ Boston, MA 02111-1307, USA. */
#define ABICALLS_ASM_OP "\t.option pic2"
-/* IRIX 5 doesn't use COFF, so disable special COFF handling in collect2.c. */
-#undef OBJECT_FORMAT_COFF
-
/* ??? This is correct, but not very useful, because there is no file that
uses this macro. */
/* ??? The best way to handle global constructors under ELF is to use .init
diff -updr config/mips.02/linux.h config/mips/linux.h
--- config/mips.02/linux.h Sun Jul 13 11:44:06 2003
+++ config/mips/linux.h Sun Jul 13 11:44:31 2003
@@ -88,9 +88,6 @@ do { \
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
-/* Required to keep collect2.c happy */
-#undef OBJECT_FORMAT_COFF
-
/* If we don't set MASK_ABICALLS, we can't default to PIC. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
diff -updr config/mips.02/mips.h config/mips/mips.h
--- config/mips.02/mips.h Sun Jul 13 11:44:06 2003
+++ config/mips/mips.h Sun Jul 13 11:44:31 2003
@@ -1328,10 +1328,6 @@ extern int mips_abi;
mips_debugger_offset (X, (HOST_WIDE_INT) 0)
#define DEBUGGER_ARG_OFFSET(OFFSET, X) \
mips_debugger_offset (X, (HOST_WIDE_INT) OFFSET)
-
-/* Tell collect that the object format is ECOFF */
-#define OBJECT_FORMAT_COFF /* Object file looks like COFF */
-#define EXTENDED_COFF /* ECOFF, not normal coff */
/* Target machine storage layout */
@@ -3831,19 +3827,6 @@ while (0)
#ifndef ASM_COMMENT_START
#define ASM_COMMENT_START " #"
#endif
-
-
-/* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for
- and mips-tdump.c to print them out.
-
- These must match the corresponding definitions in gdb/mipsread.c.
- Unfortunately, gcc and gdb do not currently share any directories. */
-
-#define CODE_MASK 0x8F300
-#define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
-#define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
-#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
-
/* Default definitions for size_t and ptrdiff_t. We must override the
definitions from ../svr4.h on mips-*-linux-gnu. */
diff -updr config/mips.02/openbsd.h config/mips/openbsd.h
--- config/mips.02/openbsd.h Mon Jun 9 07:55:15 2003
+++ config/mips/openbsd.h Sun Jul 13 11:44:31 2003
@@ -109,9 +109,3 @@ Boston, MA 02111-1307, USA. */
/* Switch into a generic section. */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
-
-/* collect2 support (Macros for initialization). */
-
-/* Mips default configuration is COFF-only, and confuses collect2. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
Part 3
------
mips.c has code to warn about changes of filename within a function.
Apparently you couldn't do that with old non-gas assemblers when using sdb.
But (as per patch 1) the only remaining users of sdb are gas targets,
so this code can go.
* config/mips/mips.c (inside_function): Delete.
(file_in_function_warning, ignore_line_number): Delete.
(mips_output_filename): Don't warn about changing filenames within
a function.
(mips_output_lineno): Update accordingly.
(mips_output_function_prologue): Don't reset the deleted variables.
* config/mips/mips.h (inside_function): Delete.
(file_in_function_warning, ignore_line_number): Delete.
diff -updr config/mips.03/mips.c config/mips/mips.c
--- config/mips.03/mips.c Tue Jul 8 18:36:01 2003
+++ config/mips/mips.c Sun Jul 13 11:45:06 2003
@@ -465,10 +465,6 @@ int sdb_label_count = 0;
/* Next label # for each statement for Silicon Graphics IRIS systems. */
int sym_lineno = 0;
-/* Nonzero if inside of a function, because the stupid MIPS asm can't
- handle .files inside of functions. */
-int inside_function = 0;
-
/* Linked list of all externals that are to be emitted when optimizing
for the global pointer if they haven't been declared by the end of
the program with an appropriate .comm or initialization. */
@@ -485,14 +481,6 @@ static GTY (()) struct extern_list *exte
/* Name of the file containing the current function. */
const char *current_function_file = "";
-/* Warning given that Mips ECOFF can't support changing files
- within a function. */
-int file_in_function_warning = FALSE;
-
-/* Whether to suppress issuing .loc's because the user attempted
- to change the filename within a function. */
-int ignore_line_number = FALSE;
-
/* Number of nested .set noreorder, noat, nomacro, and volatile requests. */
int set_noreorder;
int set_noat;
@@ -5972,8 +5960,7 @@ mips_output_external_libcall (file, name
}
#endif
-/* Emit a new filename to a stream. If this is MIPS ECOFF, watch out
- for .file's that start within a function. If we are smuggling stabs, try to
+/* Emit a new filename to a stream. If we are smuggling stabs, try to
put out a MIPS ECOFF file and a stab. */
void
@@ -6007,23 +5994,11 @@ mips_output_filename (stream, name)
}
else if (name != current_function_file
- && strcmp (name, current_function_file) != 0)
+ && strcmp (name, current_function_file) != 0)
{
- if (inside_function && !TARGET_GAS)
- {
- if (!file_in_function_warning)
- {
- file_in_function_warning = 1;
- ignore_line_number = 1;
- warning ("MIPS ECOFF format does not allow changing filenames within functions with #line");
- }
- }
- else
- {
- SET_FILE_NUMBER ();
- current_function_file = name;
- ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
- }
+ SET_FILE_NUMBER ();
+ current_function_file = name;
+ ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
}
}
@@ -6046,10 +6021,7 @@ mips_output_lineno (stream, line)
}
else
{
- fprintf (stream, "\n\t%s.loc\t%d %d\n",
- (ignore_line_number) ? "#" : "",
- num_source_filenames, line);
-
+ fprintf (stream, "\n\t.loc\t%d %d\n", num_source_filenames, line);
LABEL_AFTER_LOC (stream);
}
}
@@ -6935,8 +6907,6 @@ mips_output_function_prologue (file, siz
&& current_function_args_info.fp_code != 0)
build_mips16_function_stub (file);
- inside_function = 1;
-
#ifndef FUNCTION_NAME_ALREADY_DECLARED
/* Get the function name the same way that toplev.c does before calling
assemble_start_function. This is needed so that the name used here
@@ -7541,10 +7511,6 @@ mips_output_function_epilogue (file, siz
fputs ("\n", file);
}
#endif
-
- /* Reset state info for each function. */
- inside_function = 0;
- ignore_line_number = 0;
while (string_constants != NULL)
{
diff -updr config/mips.03/mips.h config/mips/mips.h
--- config/mips.03/mips.h Sun Jul 13 11:44:31 2003
+++ config/mips/mips.h Sun Jul 13 11:45:06 2003
@@ -114,9 +114,6 @@ extern char mips_reg_names[][8]; /* regi
extern char mips_print_operand_punct[256]; /* print_operand punctuation chars */
extern const char *current_function_file; /* filename current function is in */
extern int num_source_filenames; /* current .file # */
-extern int inside_function; /* != 0 if inside of a function */
-extern int ignore_line_number; /* != 0 if we are to ignore next .loc */
-extern int file_in_function_warning; /* warning given about .file in func */
extern int mips_section_threshold; /* # bytes of data/sdata cutoff */
extern int sym_lineno; /* sgi next label # for each stmt */
extern int set_noreorder; /* # of nested .set noreorder's */
@@ -3570,12 +3567,7 @@ do \
while (0)
-/* How to tell the debugger about changes of source files. Note, the
- mips ECOFF format cannot deal with changes of files inside of
- functions, which means the output of parser generators like bison
- is generally not debuggable without using the -l switch. Lose,
- lose, lose. Silicon graphics seems to want all .file's hardwired
- to 1. */
+/* How to tell the debugger about changes of source files. */
#ifndef SET_FILE_NUMBER
#define SET_FILE_NUMBER() ++num_source_filenames
Part 4
------
Something I forgot from my sdata patch.
* config/mips/elf.h (SBSS_SECTION_ASM_OP): Delete.
* config/mips/linux.h: Likewise.
diff -updr config/mips.04/elf.h config/mips/elf.h
--- config/mips.04/elf.h Sun Jul 13 11:44:31 2003
+++ config/mips/elf.h Sun Jul 13 11:50:09 2003
@@ -73,9 +73,6 @@ Boston, MA 02111-1307, USA. */
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#endif
-#undef SBSS_SECTION_ASM_OP
-#define SBSS_SECTION_ASM_OP "\t.section .sbss"
-
/* 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
diff -updr config/mips.04/linux.h config/mips/linux.h
--- config/mips.04/linux.h Sun Jul 13 11:44:31 2003
+++ config/mips/linux.h Sun Jul 13 11:50:09 2003
@@ -34,8 +34,6 @@ Boston, MA 02111-1307, USA. */
used. */
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-#define SBSS_SECTION_ASM_OP "\t.section .sbss"
-
/* 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
Part 5
------
Several header files have similar definitions of ASM_DECLARE_OBJECT_NAME
and ASM_FINISH_DECLARE_OBJECT. This patch moves them to mips.c.
As well as cleaning things up a bit, this makes it easier to add
sdata optimisations for irix.
* config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use
mips_declare_object_name.
(ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object.
* config/mips/elf64.h: As for elf.h.
* config/mips/iris6.h: Likewise.
* config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h.
* config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary
do...while (0) block.
* config/mips/mips-protos.h (mips_declare_object_name): Declare.
(mips_finish_declare_object): Declare.
* config/mips/mips.c (mips_declare_object_name): New function.
(mips_finish_declare_object): New function.
diff -updr config/mips.05/elf.h config/mips/elf.h
--- config/mips.05/elf.h Sun Jul 13 11:50:09 2003
+++ config/mips/elf.h Sun Jul 13 11:50:39 2003
@@ -95,50 +95,11 @@ do { \
} while (0)
#endif
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
-#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
diff -updr config/mips.05/elf64.h config/mips/elf64.h
--- config/mips.05/elf64.h Sun Jul 13 11:44:31 2003
+++ config/mips/elf64.h Sun Jul 13 11:50:39 2003
@@ -60,49 +60,11 @@ Boston, MA 02111-1307, USA. */
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
diff -updr config/mips.05/iris6.h config/mips/iris6.h
--- config/mips.05/iris6.h Tue Jul 8 18:36:01 2003
+++ config/mips/iris6.h Sun Jul 13 11:50:39 2003
@@ -370,51 +370,17 @@ while (0)
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-/* Write the extra assembler code needed to declare an object properly. */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-do \
- { \
- HOST_WIDE_INT size; \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (STREAM, NAME, size); \
- } \
- mips_declare_object (STREAM, NAME, "", ":\n", 0); \
- } \
-while (0)
-
/* Define the `__builtin_va_list' type for the ABI. On IRIX 6, this
type is `char *'. */
#undef BUILD_VA_LIST_TYPE
#define BUILD_VA_LIST_TYPE(VALIST) \
(VALIST) = build_pointer_type (char_type_node)
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
diff -updr config/mips.05/linux.h config/mips/linux.h
--- config/mips.05/linux.h Sun Jul 13 11:50:09 2003
+++ config/mips/linux.h Sun Jul 13 11:50:39 2003
@@ -54,27 +54,8 @@ do { \
ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
} while (0)
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef TARGET_VERSION
#if TARGET_ENDIAN_DEFAULT == 0
diff -updr config/mips.05/mips-protos.h config/mips/mips-protos.h
--- config/mips.05/mips-protos.h Thu Jun 19 22:47:16 2003
+++ config/mips/mips-protos.h Sun Jul 13 11:50:39 2003
@@ -35,6 +35,10 @@ extern int mips_can_use_return_insn PAR
extern void mips_declare_object PARAMS ((FILE *, const char *,
const char *,
const char *, int));
+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_expand_epilogue PARAMS ((int));
extern void mips_expand_prologue PARAMS ((void));
extern void mips_output_filename PARAMS ((FILE *, const char *));
diff -updr config/mips.05/mips.c config/mips/mips.c
--- config/mips.05/mips.c Sun Jul 13 11:49:53 2003
+++ config/mips/mips.c Sun Jul 13 11:50:39 2003
@@ -6236,6 +6236,61 @@ mips_declare_object (stream, name, init_
TREE_ASM_WRITTEN (name_tree) = 1;
}
}
+
+#ifdef ASM_OUTPUT_SIZE_DIRECTIVE
+extern int size_directive_output;
+
+/* Implement ASM_DECLARE_OBJECT_NAME. This is like most of the standard ELF
+ definitions except that it uses mips_declare_object() to emit the label. */
+
+void
+mips_declare_object_name (stream, name, decl)
+ FILE *stream;
+ const char *name;
+ tree decl ATTRIBUTE_UNUSED;
+{
+#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
+ ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
+#endif
+
+ size_directive_output = 0;
+ if (!flag_inhibit_size_directive && DECL_SIZE (decl))
+ {
+ HOST_WIDE_INT size;
+
+ size_directive_output = 1;
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+ }
+
+ mips_declare_object (stream, name, "", ":\n", 0);
+}
+
+/* Implement ASM_FINISH_DECLARE_OBJECT. This is generic ELF stuff. */
+
+void
+mips_finish_declare_object (stream, decl, top_level, at_end)
+ FILE *stream;
+ tree decl;
+ int top_level, at_end;
+{
+ const char *name;
+
+ name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ if (!flag_inhibit_size_directive
+ && DECL_SIZE (decl) != 0
+ && !at_end && top_level
+ && DECL_INITIAL (decl) == error_mark_node
+ && !size_directive_output)
+ {
+ HOST_WIDE_INT size;
+
+ size_directive_output = 1;
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+ }
+}
+#endif
/* Return the register that should be used as the global pointer
within this function. Return 0 if the function doesn't need
diff -updr config/mips.05/mips.h config/mips/mips.h
--- config/mips.05/mips.h Sun Jul 13 11:49:53 2003
+++ config/mips/mips.h Sun Jul 13 11:50:39 2003
@@ -3609,23 +3609,9 @@ while (0)
$Lc[0-9]+ Label for use in s<xx> operation.
$Le[0-9]+ End blocks for MIPS debug support */
-/* A C statement (sans semicolon) to output to the stdio stream
- STREAM any text necessary for declaring the name NAME of an
- initialized variable which is being defined. This macro must
- output the label definition (perhaps using `ASM_OUTPUT_LABEL').
- The argument DECL is the `VAR_DECL' tree node representing the
- variable.
-
- If this macro is not defined, then the variable name is defined
- in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-do \
- { \
- mips_declare_object (STREAM, NAME, "", ":\n", 0); \
- } \
-while (0)
+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
+ mips_declare_object (STREAM, NAME, "", ":\n", 0)
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl\t"
Part 6
------
elf.h and elf64.h define DBX_DEBUGGING_INFO, but that's also defined by mips.h.
* config/mips/elf.h (DBX_DEBUGGING_INFO): Delete.
* config/mips/elf64.h: Likewise.
Common subdirectories: config/mips.06/CVS and config/mips/CVS
diff -upd config/mips.06/elf.h config/mips/elf.h
--- config/mips.06/elf.h Sun Jul 13 11:50:39 2003
+++ config/mips/elf.h Sun Jul 13 11:51:32 2003
@@ -20,8 +20,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Use ELF. */
-#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
diff -upd config/mips.06/elf64.h config/mips/elf64.h
--- config/mips.06/elf64.h Sun Jul 13 11:50:39 2003
+++ config/mips/elf64.h Sun Jul 13 11:51:32 2003
@@ -20,7 +20,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
Part 7
------
This moves the ASM_OUTPUT_ALIGNED_BSS code to mips.c and (as a minor
clean-up) makes it use mips_in_small_data_p.
* 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.
diff -updr config/mips.07/elf.h config/mips/elf.h
--- config/mips.07/elf.h Sun Jul 13 11:51:32 2003
+++ config/mips/elf.h Sun Jul 13 11:52:27 2003
@@ -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 -updr config/mips.07/linux.h config/mips/linux.h
--- config/mips.07/linux.h Sun Jul 13 11:50:39 2003
+++ config/mips/linux.h Sun Jul 13 11:52:27 2003
@@ -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 -updr config/mips.07/mips-protos.h config/mips/mips-protos.h
--- config/mips.07/mips-protos.h Sun Jul 13 11:50:39 2003
+++ config/mips/mips-protos.h Sun Jul 13 11:53:04 2003
@@ -39,6 +39,9 @@ extern void mips_declare_object_name PA
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 -updr config/mips.07/mips.c config/mips/mips.c
--- config/mips.07/mips.c Sun Jul 13 11:50:39 2003
+++ config/mips/mips.c Sun Jul 13 11:52:27 2003
@@ -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
Part 8
------
The only difference between elf.h and elf64.h is that elf.h defines
ASM_OUTPUT_ALIGNED_BSS and elf64.h doesn't.
I doubt the special elf64.h treatment of uninitialised data matters any
more (if it ever did). But like I say, this patch isn't supposed to
change the output, so I don't want to get rid of the header here.
* config/mips/elf64.h: Include mips/elf.h. Undefine BSS_SECTION_ASM_OP
and ASM_OUTPUT_ALIGNED_BSS.
diff -updr config/mips.08/elf64.h config/mips/elf64.h
--- config/mips.08/elf64.h Sun Jul 13 11:51:32 2003
+++ config/mips/elf64.h Sun Jul 13 11:55:32 2003
@@ -20,105 +20,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define DWARF2_DEBUGGING_INFO 1
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-#undef SUBTARGET_ASM_DEBUGGING_SPEC
-#define SUBTARGET_ASM_DEBUGGING_SPEC "-g0"
-
-/* Biggest alignment supported by the object file format of this
- machine. Use this macro to limit the alignment which can be
- specified using the `__attribute__ ((aligned (N)))' construct. If
- not defined, the default value is `BIGGEST_ALIGNMENT'. */
-
-#undef MAX_OFILE_ALIGNMENT
-#define MAX_OFILE_ALIGNMENT (32768*8)
-
-/* Switch into a generic section. */
-#undef TARGET_ASM_NAMED_SECTION
-#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
-
-/* The following macro defines the format used to output the second
- operand of the .type assembler directive. Different svr4 assemblers
- expect various different forms for this operand. The one given here
- is just a default. You may need to override it in your machine-
- specific tm.h file (depending upon the particulars of your assembler). */
-
-#define TYPE_OPERAND_FMT "@%s"
-
-/* Define the strings used for the special svr4 .type and .size directives.
- These strings generally do not vary from one system running svr4 to
- another, but if a given system (e.g. m88k running svr) needs to use
- different pseudo-op names for these, they may be overridden in the
- file which includes this one. */
-
-#undef TYPE_ASM_OP
-#undef SIZE_ASM_OP
-#define TYPE_ASM_OP "\t.type\t"
-#define SIZE_ASM_OP "\t.size\t"
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
-
-#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
-
-#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
- do { fputc ( '\t', FILE); \
- assemble_name (FILE, LABEL1); \
- fputs ( " = ", FILE); \
- assemble_name (FILE, LABEL2); \
- fputc ( '\n', FILE); \
- } while (0)
-
-/* Note about .weak vs. .weakext
- The mips native assemblers support .weakext, but not .weak.
- mips-elf gas supports .weak, but not .weakext.
- mips-elf gas has been changed to support both .weak and .weakext,
- but until that support is generally available, the 'if' below
- should serve. */
-
-#undef ASM_WEAKEN_LABEL
-#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
-#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
- do { \
- if (TARGET_GAS) \
- fputs ("\t.weak\t", FILE); \
- else \
- fputs ("\t.weakext\t", FILE); \
- assemble_name (FILE, NAME); \
- if (VALUE) \
- { \
- fputc (' ', FILE); \
- assemble_name (FILE, VALUE); \
- } \
- fputc ('\n', FILE); \
- } while (0)
-
-#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
-
-/* On elf, we *do* have support for the .init and .fini sections, and we
- can put stuff in there to be executed before and after `main'. We let
- crtstuff.c and other files know this by defining the following symbols.
- The definitions say how to change sections to the .init and .fini
- sections. This is the same for all known elf assemblers. */
-
-#undef INIT_SECTION_ASM_OP
-#define INIT_SECTION_ASM_OP "\t.section\t.init"
-#undef FINI_SECTION_ASM_OP
-#define FINI_SECTION_ASM_OP "\t.section\t.fini"
-
-/* Don't set the target flags, this is done by the linker script */
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "crti%O%s crtbegin%O%s"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-
-/* We support #pragma. */
-#define HANDLE_SYSV_PRAGMA 1
+#include "mips/elf.h"
+#undef BSS_SECTION_ASM_OP
+#undef ASM_OUTPUT_ALIGNED_BSS