]>
Commit | Line | Data |
---|---|---|
4ce86f52 RK |
1 | /* XCOFF definitions. These are needed in dbxout.c, final.c, |
2 | and xcoffout.h. */ | |
3 | ||
4 | #define ASM_STABS_OP ".stabx" | |
5 | ||
6 | /* Tags and typedefs are C_DECL in XCOFF, not C_LSYM. */ | |
7 | ||
8 | #define DBX_DECL_STABS_CODE N_DECL | |
9 | ||
10 | /* Use the XCOFF predefined type numbers. */ | |
11 | ||
12 | /* ??? According to metin, typedef stabx must go in text control section, | |
13 | but he did not make this changes everywhere where such typedef stabx | |
14 | can be emitted, so it is really needed or not? */ | |
15 | ||
16 | #define DBX_OUTPUT_STANDARD_TYPES(SYMS) \ | |
17 | { \ | |
18 | text_section (); \ | |
19 | xcoff_output_standard_types (SYMS); \ | |
20 | } | |
21 | ||
22 | /* Any type with a negative type index has already been output. */ | |
23 | ||
24 | #define DBX_TYPE_DEFINED(TYPE) (TYPE_SYMTAB_ADDRESS (TYPE) < 0) | |
25 | ||
26 | /* Must use N_STSYM for static const variables (those in the text section) | |
27 | instead of N_FUN. */ | |
28 | ||
29 | #define DBX_STATIC_CONST_VAR_CODE N_STSYM | |
30 | ||
31 | /* For static variables, output code to define the start of a static block. */ | |
32 | ||
33 | #define DBX_STATIC_BLOCK_START(ASMFILE,CODE) \ | |
34 | { \ | |
35 | if ((CODE) == N_STSYM) \ | |
36 | fprintf ((ASMFILE), "\t.bs\t%s[RW]\n", xcoff_private_data_section_name);\ | |
37 | else if ((CODE) == N_LCSYM) \ | |
38 | fprintf ((ASMFILE), "\t.bs\t%s\n", xcoff_bss_section_name); \ | |
39 | } | |
40 | ||
41 | /* For static variables, output code to define the end of a static block. */ | |
42 | ||
43 | #define DBX_STATIC_BLOCK_END(ASMFILE,CODE) \ | |
44 | { \ | |
45 | if (current_sym_code == N_STSYM || current_sym_code == N_LCSYM) \ | |
46 | fprintf (asmfile, "\t.es\n"); \ | |
47 | } | |
48 | ||
49 | /* We must use N_RPYSM instead of N_RSYM for register parameters. */ | |
50 | ||
51 | #define DBX_REGPARM_STABS_CODE N_RPSYM | |
52 | ||
53 | /* We must use 'R' instead of 'P' for register parameters. */ | |
54 | ||
55 | #define DBX_REGPARM_STABS_LETTER 'R' | |
56 | ||
57 | /* Define our own finish symbol function, since xcoff stabs have their | |
58 | own different format. */ | |
59 | ||
60 | #define DBX_FINISH_SYMBOL(SYM) \ | |
61 | { \ | |
62 | if (current_sym_addr && current_sym_code == N_FUN) \ | |
63 | fprintf (asmfile, "\",."); \ | |
64 | else \ | |
65 | fprintf (asmfile, "\","); \ | |
66 | /* If we are writing a function name, we must ensure that \ | |
67 | there is no storage-class suffix on the name. */ \ | |
68 | if (current_sym_addr && current_sym_code == N_FUN \ | |
69 | && GET_CODE (current_sym_addr) == SYMBOL_REF) \ | |
70 | { \ | |
71 | char *_p; \ | |
72 | for (_p = XSTR (current_sym_addr, 0); *_p != '[' && *_p; _p++) \ | |
73 | fprintf (asmfile, "%c", *_p); \ | |
74 | } \ | |
75 | else if (current_sym_addr) \ | |
76 | output_addr_const (asmfile, current_sym_addr); \ | |
77 | else if (current_sym_code == N_GSYM) \ | |
19c79343 | 78 | fprintf (asmfile, "%s", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (SYM))); \ |
4ce86f52 RK |
79 | else \ |
80 | fprintf (asmfile, "%d", current_sym_value); \ | |
81 | fprintf (asmfile, ",%d,0\n", stab_to_sclass (current_sym_code)); \ | |
82 | } | |
83 | ||
84 | /* These are IBM XCOFF extensions we need to reference in dbxout.c | |
85 | and xcoffout.c. */ | |
86 | ||
87 | /* AIX XCOFF uses this for typedefs. This can have any value, since it is | |
88 | only used for translation into a C_DECL storage class. */ | |
89 | #ifndef N_DECL | |
90 | #define N_DECL 0x8c | |
91 | #endif | |
92 | /* AIX XCOFF uses this for parameters passed in registers. This can have | |
93 | any value, since it is only used for translation into a C_RPSYM storage | |
94 | class. */ | |
95 | #ifndef N_RPSYM | |
96 | #define N_RPSYM 0x8e | |
97 | #endif | |
98 | ||
99 | /* The line number of the beginning of the current function. | |
100 | xcoffout.c needs this so that it can output relative linenumbers. */ | |
101 | ||
102 | extern int xcoff_begin_function_line; | |
103 | ||
104 | /* Name of the current include file. */ | |
105 | ||
106 | extern char *xcoff_current_include_file; | |
107 | ||
108 | /* Name of the current function file. This is the file the `.bf' is | |
109 | emitted from. In case a line is emitted from a different file, | |
110 | (by including that file of course), then the line number will be | |
111 | absolute. */ | |
112 | ||
113 | extern char *xcoff_current_function_file; | |
114 | ||
115 | /* Names of bss and data sections. These should be unique names for each | |
116 | compilation unit. */ | |
117 | ||
118 | extern char *xcoff_bss_section_name; | |
119 | extern char *xcoff_private_data_section_name; | |
120 | extern char *xcoff_read_only_section_name; | |
121 | ||
122 | /* Don't write out path name for main source file. */ | |
123 | #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(FILE,FILENAME) | |
124 | ||
125 | /* Write out main source file name using ".file" rather than ".stabs". */ | |
126 | #define DBX_OUTPUT_MAIN_SOURCE_FILENAME(FILE,FILENAME) \ | |
127 | fprintf (FILE, "\t.file\t\"%s\"\n", FILENAME); | |
128 | ||
129 | #define ABS_OR_RELATIVE_LINENO(LINENO) \ | |
130 | ((xcoff_current_include_file \ | |
131 | && xcoff_current_include_file != xcoff_current_function_file) \ | |
132 | ? (LINENO) : (LINENO) - xcoff_begin_function_line) | |
133 | ||
134 | /* Output source line numbers via ".line" rather than ".stabd". */ | |
135 | #define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM) \ | |
136 | do { \ | |
137 | if (xcoff_begin_function_line >= 0) \ | |
138 | fprintf (FILE, "\t.line\t%d\n", ABS_OR_RELATIVE_LINENO (LINENUM)); \ | |
139 | } while (0) | |
140 | ||
141 | /* We don't want to emit source file names in dbx style. */ | |
142 | #define DBX_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \ | |
143 | { \ | |
144 | if (xcoff_current_include_file) \ | |
145 | fprintf (FILE, "\t.ei\t\"%s\"\n", xcoff_current_include_file);\ | |
146 | if (strcmp (main_input_filename, FILENAME)) \ | |
147 | { \ | |
148 | fprintf (FILE, "\t.bi\t\"%s\"\n", FILENAME); \ | |
149 | xcoff_current_include_file = FILENAME; \ | |
150 | } \ | |
151 | else \ | |
152 | xcoff_current_include_file = NULL; \ | |
153 | } | |
154 | ||
155 | /* If we are still in an include file, its end must be marked. */ | |
156 | #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ | |
157 | { \ | |
158 | if (xcoff_current_include_file) \ | |
159 | { \ | |
160 | fprintf ((FILE), "\t.ei\t\"%s\"\n", \ | |
161 | xcoff_current_include_file); \ | |
162 | xcoff_current_include_file = NULL; \ | |
163 | } \ | |
164 | } | |
165 | ||
166 | /* Do not break .stabs pseudos into continuations. */ | |
167 | #define DBX_CONTIN_LENGTH 0 | |
168 | ||
169 | /* Don't try to use the `x' type-cross-reference character in DBX data. | |
170 | Also has the consequence of putting each struct, union or enum | |
171 | into a separate .stabs, containing only cross-refs to the others. */ | |
172 | #define DBX_NO_XREFS |