elf.h (ASM_DECLARE_OBJECT_NAME): Use mips_declare_object_name.

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

From-SVN: r69352
This commit is contained in:
Richard Sandiford 2003-07-14 20:23:38 +00:00 committed by Richard Sandiford
parent 748d4c7e65
commit c1115ccd68
8 changed files with 84 additions and 156 deletions

View File

@ -1,5 +1,18 @@
2003-07-14 Richard Sandiford <rsandifo@redhat.com>
* 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.
* config/mips/elf.h (SBSS_SECTION_ASM_OP): Delete.
* config/mips/linux.h: Likewise.

View File

@ -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. */
#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
/* 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_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); \

View File

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

View File

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

View File

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

View File

@ -35,6 +35,10 @@ extern int mips_can_use_return_insn PARAMS ((void));
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 *));

View File

@ -6236,6 +6236,61 @@ mips_declare_object (stream, name, init_string, final_string, size)
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

View File

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