X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fconfig%2Fsvr3.h;h=8e1e9063e95ea8dc8a633982636e174d8c61a7ea;hp=61b0da1d3bd556412f2049c210cf3304e2b02cec;hb=78fb562b5130e000bd196cdca12ddfc65165a68c;hpb=b7b4a1139ffb6002e3cf6c599876326c8644deaa diff --git a/gcc/config/svr3.h b/gcc/config/svr3.h index 61b0da1d3bd..8e1e9063e95 100644 --- a/gcc/config/svr3.h +++ b/gcc/config/svr3.h @@ -1,8 +1,7 @@ -/* svr3.h -- operating system specific defines to be used when - targeting GCC for some generic System V Release 3 system. - Copyright (C) 1991 Free Software Foundation, Inc. - - Written by Ron Guilmette (rfg@ncd.com). +/* Operating system specific defines to be used when targeting GCC for + generic System V Release 3 system. + Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc. + Contributed by Ron Guilmette (rfg@monkeys.com). This file is part of GNU CC. @@ -18,7 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. To use this file, make up a file with a name like: @@ -39,6 +39,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. appropriate define for the type of hardware that you are targeting. */ +/* Define a symbol indicating that we are using svr3.h. */ +#define USING_SVR3_H + /* Define a symbol so that libgcc* can know what sort of operating environment and assembler syntax we are targeting for. */ #define SVR3_target @@ -58,7 +61,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #undef ASM_FILE_START #define ASM_FILE_START(FILE) \ do { output_file_directive ((FILE), main_input_filename); \ - if (optimize) ASM_FILE_START_1 (FILE); \ + if (optimize) { ASM_FILE_START_1 (FILE); } \ } while (0) /* By default, do nothing: a few machines support .optim, but not most. */ @@ -99,19 +102,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #define STARTFILE_SPEC \ "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" +#ifdef CROSS_COMPILE +#define LIB_SPEC "-lc crtn.o%s" +#else #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s" +#endif /* Special flags for the linker. I don't know what they do. */ #define LINK_SPEC "%{T*} %{z:-lm}" #endif -/* Allow #sccs in preprocessor. */ - -#define SCCS_DIRECTIVE - /* Output #ident as a .ident. */ +#undef ASM_OUTPUT_IDENT #define ASM_OUTPUT_IDENT(FILE, NAME) \ fprintf (FILE, "\t.ident \"%s\"\n", NAME); @@ -125,7 +129,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. /* System V Release 3 uses COFF debugging info. */ -#define SDB_DEBUGGING_INFO +#define SDB_DEBUGGING_INFO 1 /* We don't want to output DBX debugging information. */ @@ -146,30 +150,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -/* Assembler pseudos to introduce constants of various size. These - definitions hsould work for most svr3 systems. */ - -#undef ASM_BYTE_OP -#define ASM_BYTE_OP "\t.byte" - -/* This is how to output a reference to a user-level label named NAME. - `assemble_name' uses this. +/* The prefix to add to user-visible assembler symbols. For System V Release 3 the convention is to prepend a leading underscore onto user-level symbol names. */ -#undef ASM_OUTPUT_LABELREF -#define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "_%s", NAME) - -/* This is how to output an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. - - For most svr3 systems, the convention is that any symbol which begins - with a period is not put into the linker symbol table by the assembler. */ - -#undef ASM_OUTPUT_INTERNAL_LABEL -#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ - asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM) +#undef USER_LABEL_PREFIX +#define USER_LABEL_PREFIX "_" /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where @@ -181,22 +168,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ - sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM) + sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM)) /* We want local labels to start with period if made with asm_fprintf. */ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* Support const sections and the ctors and dtors sections for g++. - Note that there appears to be two different ways to support const - sections at the moment. You can either #define the symbol - READONLY_DATA_SECTION (giving it some code which switches to the - readonly data section) or else you can #define the symbols - EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and - SELECT_RTX_SECTION. We do both here just to be on the safe side. - However, use of the const section is turned off by default - unless the specific tm.h file turns it on by defining - USE_CONST_SECTION as 1. */ +/* Support const sections and the ctors and dtors sections for g++. */ /* Define a few machine-specific details of the implementation of constructors. @@ -205,20 +183,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. and CTOR_LIST_END to contribute to the .init section an instruction to push a word containing 0 (or some equivalent of that). - Define ASM_OUTPUT_CONSTRUCTOR to push the address of the constructor. */ - -#define USE_CONST_SECTION 0 + Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor. */ -#define INIT_SECTION_ASM_OP ".section\t.init" -#define FINI_SECTION_ASM_OP ".section .fini,\"x\"" -#define CONST_SECTION_ASM_OP ".section\t.rodata, \"x\"" -#define CTORS_SECTION_ASM_OP INIT_SECTION_ASM_OP +#define INIT_SECTION_ASM_OP "\t.section\t.init" +#define FINI_SECTION_ASM_OP "\t.section .fini,\"x\"" #define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP /* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent because they push on the stack. */ -#ifdef STACK_GROWS_DOWNWARD +#ifndef STACK_GROWS_DOWNWARD /* Constructor list on stack is in reverse order. Go to the end of the list and go backwards to call constructors in the right order. */ @@ -243,25 +217,21 @@ do { \ #endif /* STACK_GROWS_DOWNWARD */ -/* Add extra sections .init and .fini, in addition to .bss from att386.h. */ - #undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_const, in_bss, in_init, in_fini +#define EXTRA_SECTIONS in_init, in_fini #undef EXTRA_SECTION_FUNCTIONS #define EXTRA_SECTION_FUNCTIONS \ - CONST_SECTION_FUNCTION \ - BSS_SECTION_FUNCTION \ INIT_SECTION_FUNCTION \ FINI_SECTION_FUNCTION #define INIT_SECTION_FUNCTION \ void \ -init_section () \ +init_section () \ { \ if (in_section != in_init) \ { \ - fprintf (asm_out_file, "\t%s\n", INIT_SECTION_ASM_OP); \ + fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \ in_section = in_init; \ } \ } @@ -272,95 +242,7 @@ fini_section () \ { \ if (in_section != in_fini) \ { \ - fprintf (asm_out_file, "\t%s\n", FINI_SECTION_ASM_OP); \ + fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \ in_section = in_fini; \ } \ } - -#define READONLY_DATA_SECTION() const_section () - -#define CONST_SECTION_FUNCTION \ -void \ -const_section () \ -{ \ - extern void text_section(); \ - if (!USE_CONST_SECTION) \ - text_section(); \ - else if (in_section != in_const) \ - { \ - fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \ - in_section = in_const; \ - } \ -} - -#if 0 -#define CTORS_SECTION_FUNCTION \ -void \ -ctors_section () \ -{ \ - if (in_section != in_ctors) \ - { \ - fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ - in_section = in_ctors; \ - } \ -} - -#define DTORS_SECTION_FUNCTION \ -void \ -dtors_section () \ -{ \ - if (in_section != in_dtors) \ - { \ - fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ - in_section = in_dtors; \ - } \ -} -#endif - -/* This is machine-dependent - because it needs to push something on the stack. */ -#undef ASM_OUTPUT_CONSTRUCTOR - -/* A C statement (sans semicolon) to output an element in the table of - global destructors. */ -#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ - do { \ - fini_section (); \ - fprintf (FILE, "%s\t ", ASM_LONG); \ - assemble_name (FILE, NAME); \ - fprintf (FILE, "\n"); \ - } while (0) - -/* A C statement or statements to switch to the appropriate - section for output of DECL. DECL is either a `VAR_DECL' node - or a constant of some sort. RELOC indicates whether forming - the initial value of DECL requires link-time relocations. */ - -#define SELECT_SECTION(DECL,RELOC) \ -{ \ - if (TREE_CODE (DECL) == STRING_CST) \ - { \ - if (! flag_writable_strings) \ - const_section (); \ - else \ - data_section (); \ - } \ - else if (TREE_CODE (DECL) == VAR_DECL) \ - { \ - if ((0 && RELOC) /* should be (flag_pic && RELOC) */ \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \ - data_section (); \ - else \ - const_section (); \ - } \ - else \ - const_section (); \ -} - -/* A C statement or statements to switch to the appropriate - section for output of RTX in mode MODE. RTX is some kind - of constant in RTL. The argument MODE is redundant except - in the case of a `const_int' rtx. Currently, these always - go into the const section. */ - -#define SELECT_RTX_SECTION(MODE,RTX) const_section()