diff options
| author | thorpej <thorpej@NetBSD.org> | 2001-12-20 00:18:01 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2001-12-20 00:18:01 +0000 |
| commit | c3af5af42b3e4e16fe4519b697c736e6f920fc75 (patch) | |
| tree | d443ab09d1ccf7227e76ae10b0f14f49ec460ec5 /gnu | |
| parent | 4c9a2ef7d369b6aa36f906446e0ff03d8d96ec34 (diff) | |
Redo previous differently: Put the ASM_DECLARE_OBJECT_NAME
and ASM_FINISH_DECLARE_OBJECT macros in <alpha/netbsd.h>,
and remove ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_OBJECT_NAME,
ASM_FINISH_DECLARE_OBJECT, and ASM_DECLARE_FUNCTION_SIZE from
<netbsd.h>.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/toolchain/gcc/config/alpha/netbsd.h | 61 | ||||
| -rw-r--r-- | gnu/dist/toolchain/gcc/config/netbsd.h | 92 | ||||
| -rw-r--r-- | gnu/dist/toolchain/gcc/config/rs6000/netbsd.h | 50 |
3 files changed, 49 insertions, 154 deletions
diff --git a/gnu/dist/toolchain/gcc/config/alpha/netbsd.h b/gnu/dist/toolchain/gcc/config/alpha/netbsd.h index ab8fdb65b1a..63bb5f35eac 100644 --- a/gnu/dist/toolchain/gcc/config/alpha/netbsd.h +++ b/gnu/dist/toolchain/gcc/config/alpha/netbsd.h @@ -134,18 +134,6 @@ do { \ alpha_output_lineno (STREAM, LINE) extern void alpha_output_lineno (); -/* netbsd.h re-defined these, but we want the values from alpha.h */ - -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ - alpha_start_function(FILE,NAME,DECL); -extern void alpha_start_function (); - -#undef ASM_DECLARE_FUNCTION_SIZE -#define ASM_DECLARE_FUNCTION_SIZE(FILE,NAME,DECL) \ - alpha_end_function(FILE,NAME,DECL) -extern void alpha_end_function (); - extern void output_file_directive (); /* Attach a special .ident directive to the end of the file to identify @@ -471,6 +459,55 @@ void FN () \ assemble_name(FILE, NAME2); \ fputc('\n', FILE); } 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. */ + +#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ + do { \ + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ + assemble_name (FILE, NAME); \ + putc (',', FILE); \ + fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ + putc ('\n', FILE); \ + size_directive_output = 0; \ + if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ + { \ + size_directive_output = 1; \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ + } \ + ASM_OUTPUT_LABEL(FILE, NAME); \ + } 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_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ +do { \ + char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ + 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; \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, name); \ + putc (',', FILE); \ + fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \ + int_size_in_bytes (TREE_TYPE (DECL))); \ + putc ('\n', FILE); \ + } \ +} while (0) + /* A table of bytes codes used by the ASM_OUTPUT_ASCII and ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table corresponds to a particular byte value [0..255]. For any diff --git a/gnu/dist/toolchain/gcc/config/netbsd.h b/gnu/dist/toolchain/gcc/config/netbsd.h index 18720c91fad..15ea036e1a0 100644 --- a/gnu/dist/toolchain/gcc/config/netbsd.h +++ b/gnu/dist/toolchain/gcc/config/netbsd.h @@ -191,96 +191,4 @@ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \ %{static:-static}}" -/* 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 a function properly. - Some svr4 assemblers need to also have something extra said about the - function's return value. We allow for that here. */ - -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ - do { \ - fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ - assemble_name (FILE, NAME); \ - putc (',', FILE); \ - fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ - putc ('\n', FILE); \ - ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - ASM_OUTPUT_LABEL(FILE, NAME); \ - } while (0) - -/* 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 { \ - fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ - assemble_name (FILE, NAME); \ - putc (',', FILE); \ - fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ - putc ('\n', FILE); \ - size_directive_output = 0; \ - if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ - { \ - size_directive_output = 1; \ - fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - assemble_name (FILE, NAME); \ - putc (',', FILE); \ - fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \ - int_size_in_bytes (TREE_TYPE (DECL))); \ - fputc ('\n', FILE); \ - } \ - ASM_OUTPUT_LABEL(FILE, NAME); \ - } 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 { \ - char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ - 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; \ - fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - assemble_name (FILE, name); \ - putc (',', FILE); \ - fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \ - int_size_in_bytes (TREE_TYPE (DECL))); \ - fputc ('\n', FILE); \ - } \ -} while (0) - -/* This is how to declare the size of a function. */ - -#undef ASM_DECLARE_FUNCTION_SIZE -#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ - do { \ - if (!flag_inhibit_size_directive) \ - { \ - char label[256]; \ - static int labelno; \ - labelno++; \ - ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ - ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ - fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - assemble_name (FILE, (FNAME)); \ - fprintf (FILE, ","); \ - assemble_name (FILE, label); \ - fprintf (FILE, "-"); \ - assemble_name (FILE, (FNAME)); \ - putc ('\n', FILE); \ - } \ - } while (0) - #endif /* NETBSD_ELF */ diff --git a/gnu/dist/toolchain/gcc/config/rs6000/netbsd.h b/gnu/dist/toolchain/gcc/config/rs6000/netbsd.h index 1f914207baa..80f52ae9032 100644 --- a/gnu/dist/toolchain/gcc/config/rs6000/netbsd.h +++ b/gnu/dist/toolchain/gcc/config/rs6000/netbsd.h @@ -71,53 +71,3 @@ %{posix:-D_POSIX_SOURCE} \ %{msoft-float:-D_SOFT_FLOAT} \ %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}}" - -/* <netbsd.h> redefined a bunch of these things, but we actually want the - <rs6000/sysv4.h> versions. */ - -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ - do { \ - char *orig_name; \ - char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ - STRIP_NAME_ENCODING (orig_name, NAME); \ - \ - if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag)) \ - { \ - char buf[256], *buf_ptr; \ - \ - ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \ - \ - ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \ - STRIP_NAME_ENCODING (buf_ptr, buf); \ - fprintf (FILE, "\t%s %s-", init_ptr, buf_ptr); \ - \ - ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \ - fprintf (FILE, "%s\n", buf_ptr); \ - } \ - \ - fprintf (FILE, "\t%s\t %s,", TYPE_ASM_OP, orig_name); \ - fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ - putc ('\n', FILE); \ - ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - \ - if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \ - { \ - char *desc_name = orig_name; \ - \ - while (*desc_name == '.') \ - desc_name++; \ - \ - if (TREE_PUBLIC (DECL)) \ - fprintf (FILE, "\t.globl %s\n", desc_name); \ - \ - fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ - fprintf (FILE, "%s:\n", desc_name); \ - fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \ - fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \ - if (DEFAULT_ABI == ABI_AIX) \ - fprintf (FILE, "\t%s 0\n", init_ptr); \ - fprintf (FILE, "\t.previous\n"); \ - } \ - fprintf (FILE, "%s:\n", orig_name); \ - } while (0) |
