1 /* Definitions for Intel 386 running system V, using dbx-in-coff encapsulation.
2 Copyright (C) 1992 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #include "i386/svr3gas.h"
22 /* We do not want to output SDB debugging information. */
24 #undef SDB_DEBUGGING_INFO
26 /* We want to output DBX debugging information. */
28 #define DBX_DEBUGGING_INFO
30 /* Compensate for botch in dbxout_init/dbxout_source_file which
31 unconditionally drops the first character from ltext_label_name */
33 #undef ASM_GENERATE_INTERNAL_LABEL
34 #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
35 sprintf ((BUF), "*.%s%d", (PREFIX), (NUMBER))
37 /* With the current gas, .align N aligns to an N-byte boundary.
38 This is done to be compatible with the system assembler.
39 You have specify -DOTHER_ALIGN wenn building gas-1.38.1. */
41 #undef ASM_OUTPUT_ALIGN
42 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
43 if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
45 /* Align labels, etc. at 4-byte boundaries.
46 For the 486, align to 16-byte boundary for sake of cache. */
48 #undef ASM_OUTPUT_ALIGN_CODE
49 #define ASM_OUTPUT_ALIGN_CODE(FILE) \
50 fprintf ((FILE), "\t.align %d,0x90\n", \
51 1 << i386_align_jumps)
53 /* Align start of loop at 4-byte boundary. */
55 #undef ASM_OUTPUT_LOOP_ALIGN
56 #define ASM_OUTPUT_LOOP_ALIGN(FILE) \
57 fprintf ((FILE), "\t.align %d,0x90\n", 1 << i386_align_loops);
60 /* Additional overrides needed for dbx-in-coff gas, mostly taken from pbb.h */
62 /* Although the gas we use can create .ctor and .dtor sections from N_SETT
63 stabs, it does not support section directives, so we need to have the loader
66 #define CTOR_LISTS_DEFINED_EXTERNALLY
68 /* similar to default, but allows for the table defined by ld with svr3.ifile.
69 nptrs is always 0. So we need to instead check that __DTOR_LIST__[1] != 0.
70 The old check is left in so that the same macro can be used if and when
71 a future version of gas does support section directives. */
73 #define DO_GLOBAL_DTORS_BODY {int nptrs = *(int *)__DTOR_LIST__; int i; \
74 if (nptrs == -1 || (__DTOR_LIST__[0] == 0 && __DTOR_LIST__[1] != 0)) \
75 for (nptrs = 0; __DTOR_LIST__[nptrs + 1] != 0; nptrs++); \
76 for (i = nptrs; i >= 1; i--) \
77 __DTOR_LIST__[i] (); }
79 /* Use crt1.o as a startup file and crtn.o as a closing file. */
81 * The loader directive file svr3.ifile defines how to merge the constructor
82 * sections into the data section. Also, since gas only puts out those
83 * sections in response to N_SETT stabs, and does not (yet) have a
84 * ".sections" directive, svr3.ifile also defines the list symbols
85 * __DTOR_LIST__ and __CTOR_LIST__.
88 #define STARTFILE_SPEC \
89 "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\
90 %{pg:gcrt1.o%s}%{!pg:%{posix:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}%{!posix:%{p:mcrt1.o%s}%{!p:crt1.o%s}}} \
91 %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}"
93 #define ENDFILE_SPEC "crtn.o%s"
96 #define LIB_SPEC "%{posix:-lcposix} %{shlib:-lc_s} -lc -lg"