--- gcc/config/m88k/dgux.h 2018/04/24 18:14:04 1.1.1.2 +++ gcc/config/m88k/dgux.h 2018/04/24 18:27:49 1.1.1.4 @@ -1,9 +1,8 @@ /* Definitions of target machine for GNU compiler. Motorola m88100 running DG/UX. - Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 93, 94, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@mcc.com) - Enhanced by Michael Meissner (meissner@osf.org) - Version 2 port by Tom Wood (Tom_Wood@NeXT.com) + Currently maintained by (gcc@dg-rtp.dg.com) This file is part of GNU CC. @@ -19,19 +18,20 @@ GNU General Public License for more deta 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. */ /* You're not seeing double! To transition to dwarf debugging, both are - supported. The option -msvr4 and -mversion-03.00 specify (for DG/UX) - `real' elf. With these combinations, -g means dwarf. */ + supported. The option -msvr4 specifies elf. With these combinations, + -g means dwarf. */ /* DWARF_DEBUGGING_INFO defined in svr4.h. */ #define SDB_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE \ - (GET_VERSION_0300_SYNTAX ? DWARF_DEBUG : SDB_DEBUG) -/* This controls a bug fix in cp-decl.c. - For version 2.6, someone should figure out the right condition. */ -#define RMS_QUICK_HACK_1 + (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG) +#ifndef VERSION_INFO2 +#define VERSION_INFO2 "$Revision: 1.1.1.4 $" +#endif #ifndef NO_BUGS #define AS_BUG_IMMEDIATE_LABEL /* The DG/UX 4.30 assembler doesn't accept the symbol `fcr63'. */ @@ -43,17 +43,18 @@ the Free Software Foundation, 675 Mass A /* Augment TARGET_SWITCHES with the MXDB options. */ #define MASK_STANDARD 0x40000000 /* Retain standard information */ -#define MASK_LEGEND 0x20000000 /* Retain legend information */ +#define MASK_NOLEGEND 0x20000000 /* Discard legend information */ #define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */ #define TARGET_STANDARD (target_flags & MASK_STANDARD) -#define TARGET_LEGEND (target_flags & MASK_LEGEND) +#define TARGET_NOLEGEND (target_flags & MASK_NOLEGEND) #define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND) #undef SUBTARGET_SWITCHES #define SUBTARGET_SWITCHES \ { "standard", MASK_STANDARD }, \ - { "legend", MASK_LEGEND }, \ + { "legend", -MASK_NOLEGEND }, \ + { "no-legend", MASK_NOLEGEND }, \ { "external-legend", MASK_EXTERNAL_LEGEND }, \ /* the following is used only in the *_SPEC's */ \ { "keep-coff", 0 }, @@ -62,7 +63,9 @@ the Free Software Foundation, 675 Mass A #undef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_CHECK_ZERO_DIV | \ MASK_OCS_DEBUG_INFO | \ - MASK_OCS_FRAME_POSITION) + MASK_OCS_FRAME_POSITION | \ + MASK_STANDARD | \ + MASK_SVR4) #undef CPU_DEFAULT #define CPU_DEFAULT MASK_88000 @@ -73,7 +76,7 @@ the Free Software Foundation, 675 Mass A #undef CPP_PREDEFINES #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\ - -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(m88k) -Amachine(m88k)" + -D__svr4__ -Asystem(unix) -Acpu(m88k) -Amachine(m88k)" /* If -m88100 is in effect, add -Dm88100; similarly for -m88110. Here, the CPU_DEFAULT is assumed to be -m88000. If not -ansi, @@ -82,35 +85,40 @@ the Free Software Foundation, 675 Mass A #undef CPP_SPEC #define CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \ %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \ - %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}" + %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}} \ + %{msvr3:-D_M88KBCS_TARGET} %{!msvr3:-D_DGUX_TARGET}" /* Assembler support (-V, silicon filter, legends for mxdb). */ #undef ASM_SPEC #define ASM_SPEC "\ %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\ -%{msvr4:%{mversion-03.00:-KV3}%{!mversion-03.00:%{mversion-*:-KV%*}}}}\ -%{!mlegend:%{mstandard:-Wc,off}}\ -%{mlegend:-Wc,-fix-bb,-h\"gcc-2.3.3\",-s\"%i\"\ +%{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ +%{g:\ +%{mno-legend:-Wc,off}\ +%{!mno-legend:-Wc,-fix-bb,-s\"%i\"\ %{traditional:,-lc}%{!traditional:,-lansi-c}\ %{mstandard:,-keep-std}\ %{mkeep-coff:,-keep-coff}\ %{mexternal-legend:,-external}\ -%{mocs-frame-position:,-ocs}}" +%{mocs-frame-position:,-ocs}}}" /* Override svr4.h. */ #undef ASM_FINAL_SPEC #undef STARTFILE_SPEC /* Linker and library spec's. + -msvr4 is the default if -msvr3 is not specified. -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options. - -svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line. - The absense of -msvr4 indicates linking done in a COFF environment and - adds the link script to the link line. In all environments, the first - and last objects are crtbegin.o and crtend.o. - When the -G link option is used (-shared and -symbolic) a final link is - not being done. */ + -svr4 instructs gcc to place /usr/lib/values-X[cat].o on the link line. + -msvr3 indicates linking done in a COFF environment and the link + script is added to the link line. In all environments, the first + and last objects are crtbegin.o (or bcscrtbegin.o) and crtend.o. + When the -G link option is used (-shared and -symbolic) a final + link is not being done. */ +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend.o%s" #undef LIB_SPEC -#define LIB_SPEC "%{msvr4:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}} crtend.o%s" +#define LIB_SPEC "%{!msvr3:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}}" #undef LINK_SPEC #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \ %{static:-dn -Bstatic} \ @@ -120,34 +128,34 @@ the Free Software Foundation, 675 Mass A #undef STARTFILE_SPEC #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \ %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \ - %{!msvr4:m88kdgux.ld%s} crtbegin.o%s \ + %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \ + %{!msvr3:crtbegin.o%s} \ %{svr4:%{ansi:/lib/values-Xc.o} \ %{!ansi:%{traditional:/lib/values-Xt.o} \ %{!traditional:/usr/lib/values-Xa.o}}}}}" +#undef GPLUSPLUS_INCLUDE_DIR +#define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include" + /* Fast DG/UX version of profiler that does not require lots of registers to be stored. */ #undef FUNCTION_PROFILER #define FUNCTION_PROFILER(FILE, LABELNO) \ output_function_profiler (FILE, LABELNO, "gcc.mcount", 0) -/* DGUX V.4 isn't quite ELF--yet. */ -#undef VERSION_0300_SYNTAX -#define VERSION_0300_SYNTAX (TARGET_SVR4 && m88k_version_0300) - -/* Same, but used before OVERRIDE_OPTIONS has been processed. */ -#define GET_VERSION_0300_SYNTAX \ - (TARGET_SVR4 && m88k_version != 0 && strcmp (m88k_version, "03.00") >= 0) - /* Output the legend info for mxdb when debugging except if standard debugging information only is explicitly requested. */ #undef ASM_FIRST_LINE #define ASM_FIRST_LINE(FILE) \ do { \ - if (m88k_version) \ - fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, m88k_version); \ - if (write_symbols != NO_DEBUG \ - && ! (TARGET_STANDARD && ! TARGET_LEGEND)) \ + if (TARGET_SVR4) \ + { \ + if (TARGET_88110) \ + fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "04.00"); \ + else \ + fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00"); \ + } \ + if (write_symbols != NO_DEBUG && !TARGET_NOLEGEND) \ { \ fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"", \ VERSION_STRING, main_input_filename); \ @@ -170,19 +178,39 @@ the Free Software Foundation, 675 Mass A /* Override svr4.h and m88k.h except when compiling crtstuff.c. These must be constant strings when compiling crtstuff.c. Otherwise, respect the -mversion-STRING option used. */ -#if !defined (CRT_BEGIN) && !defined (CRT_END) +#undef INIT_SECTION_PREAMBLE +#undef INIT_SECTION_ASM_OP +#undef FINI_SECTION_ASM_OP +#undef CTORS_SECTION_ASM_OP +#undef DTORS_SECTION_ASM_OP + +#if defined (CRT_BEGIN) || defined (CRT_END) || defined (L__main) +/* routines to invoke global constructors and destructors are always COFF + to enable linking mixed COFF and ELF objects */ +#define FINI_SECTION_ASM_OP ("section .fini,\"x\"") +#ifndef BCS +#define INIT_SECTION_PREAMBLE asm ("\taddu\tr31,r31,0x20") +#endif #undef INIT_SECTION_ASM_OP -#define INIT_SECTION_ASM_OP (VERSION_0300_SYNTAX \ - ? "section\t .init,\"xa\"" \ - : "section\t .init,\"x\"") +#define INIT_SECTION_ASM_OP ("section\t .init,\"x\"") #undef CTORS_SECTION_ASM_OP -#define CTORS_SECTION_ASM_OP (VERSION_0300_SYNTAX \ - ? "section\t .ctors,\"aw\"" \ - : "section\t .ctors,\"d\"") +#define CTORS_SECTION_ASM_OP ("section\t .ctors,\"d\"") #undef DTORS_SECTION_ASM_OP -#define DTORS_SECTION_ASM_OP (VERSION_0300_SYNTAX \ - ? "section\t .dtors,\"aw\"" \ - : "section\t .dtors,\"d\"") +#define DTORS_SECTION_ASM_OP ("section\t .dtors,\"d\"") +#undef OBJECT_FORMAT_ELF +#else +#undef INIT_SECTION_ASM_OP +#define INIT_SECTION_ASM_OP (TARGET_SVR4 \ + ? "section\t .init,\"xa\"" \ + : "section\t .init,\"x\"") +#undef CTORS_SECTION_ASM_OP +#define CTORS_SECTION_ASM_OP (TARGET_SVR4 \ + ? "section\t .ctors,\"aw\"" \ + : "section\t .ctors,\"d\"") +#undef DTORS_SECTION_ASM_OP +#define DTORS_SECTION_ASM_OP (TARGET_SVR4 \ + ? "section\t .dtors,\"aw\"" \ + : "section\t .dtors,\"d\"") #endif /* crtstuff.c */ /* The lists of global object constructors and global destructors are always @@ -194,10 +222,19 @@ the Free Software Foundation, 675 Mass A entries. */ /* Mark the end of the .ctors/.dtors sections with a -1. */ + +#define CTOR_LIST_BEGIN \ +asm (CTORS_SECTION_ASM_OP); \ +func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) } + #define CTOR_LIST_END \ asm (CTORS_SECTION_ASM_OP); \ func_ptr __CTOR_END__[1] = { (func_ptr) (-1) } +#define DTOR_LIST_BEGIN \ +asm (DTORS_SECTION_ASM_OP); \ +func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) } + #define DTOR_LIST_END \ asm (DTORS_SECTION_ASM_OP); \ func_ptr __DTOR_END__[1] = { (func_ptr) (-1) } @@ -221,3 +258,18 @@ func_ptr __DTOR_END__[1] = { (func_ptr) if (((int *)__DTOR_LIST__)[i] != 0) \ __DTOR_LIST__[i] (); \ } while (0) + +/* The maximum alignment which the object file format can support. + page alignment would seem to be enough */ +#undef MAX_OFILE_ALIGNMENT +#define MAX_OFILE_ALIGNMENT 0x1000 + +/* Must use data section for relocatable constants when pic. */ +#undef SELECT_RTX_SECTION +#define SELECT_RTX_SECTION(MODE,RTX) \ +{ \ + if (flag_pic && symbolic_operand (RTX)) \ + data_section (); \ + else \ + const_section (); \ +}