933f18409c62c653e3d96f8357ac672e32eb0fe3
[gcc.git] / gcc / config / i386 / go32.h
1 /* Configuration for an i386 running MS-DOS with djgpp/go32. */
2
3 #include "dbxcoff.h"
4
5 #define NO_STAB_H /* DJGPP has no stab.h */
6
7 /* Don't assume anything about the header files. */
8 #define NO_IMPLICIT_EXTERN_C
9
10 #define HANDLE_SYSV_PRAGMA
11
12 #define YES_UNDERSCORES
13
14 #include "i386/gas.h"
15
16 #ifdef CPP_PREDEFINES
17 #undef CPP_PREDEFINES
18 #endif
19 #define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DMSDOS \
20 -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
21
22 #undef EXTRA_SECTIONS
23 #define EXTRA_SECTIONS in_ctor, in_dtor
24
25 #undef EXTRA_SECTION_FUNCTIONS
26 #define EXTRA_SECTION_FUNCTIONS \
27 CTOR_SECTION_FUNCTION \
28 DTOR_SECTION_FUNCTION
29
30 #define CTOR_SECTION_FUNCTION \
31 void \
32 ctor_section () \
33 { \
34 if (in_section != in_ctor) \
35 { \
36 fprintf (asm_out_file, "\t.section .ctor\n"); \
37 in_section = in_ctor; \
38 } \
39 }
40
41 #define DTOR_SECTION_FUNCTION \
42 void \
43 dtor_section () \
44 { \
45 if (in_section != in_dtor) \
46 { \
47 fprintf (asm_out_file, "\t.section .dtor\n"); \
48 in_section = in_dtor; \
49 } \
50 }
51
52 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
53 do { \
54 ctor_section (); \
55 fprintf (FILE, "%s\t", ASM_LONG); \
56 assemble_name (FILE, NAME); \
57 fprintf (FILE, "\n"); \
58 } while (0)
59
60 /* Allow (eg) __attribute__((section "locked")) to work */
61 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME)\
62 do { \
63 fprintf (FILE, "\t.section %s\n", NAME); \
64 } while (0)
65
66 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
67 do { \
68 dtor_section (); \
69 fprintf (FILE, "%s\t", ASM_LONG); \
70 assemble_name (FILE, NAME); \
71 fprintf (FILE, "\n"); \
72 } while (0)
73
74 /* Output at beginning of assembler file. */
75 /* The .file command should always begin the output. */
76 /* Use the main_input_filename instead of dump_base_name */
77
78 #undef ASM_FILE_START
79 #define ASM_FILE_START(FILE) \
80 do { \
81 output_file_directive (FILE, main_input_filename); \
82 } while (0)
83
84 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME)\
85 do { \
86 fprintf (FILE, "\t.section %s\n", NAME); \
87 } while (0)
88
89 /* This is how to output an assembler line
90 that says to advance the location counter
91 to a multiple of 2**LOG bytes. */
92
93 #undef ASM_OUTPUT_ALIGN
94 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
95 if ((LOG) != 0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))