6388247b45299e76945461d014e8dce810ea66ed
[deliverable/binutils-gdb.git] / ld / ldlex.h
1 /* ldlex.h -
2 Copyright (C) 1991-2020 Free Software Foundation, Inc.
3
4 This file is part of the GNU Binutils.
5
6 This program 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 3 of the License, or
9 (at your option) any later version.
10
11 This program 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.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
20
21 #ifndef LDLEX_H
22 #define LDLEX_H
23
24 #include <stdio.h>
25
26 /* Codes used for the long options with no short synonyms. 150 isn't
27 special; it's just an arbitrary non-ASCII char value. */
28 enum option_values
29 {
30 OPTION_ASSERT = 150,
31 OPTION_CALL_SHARED,
32 OPTION_CREF,
33 OPTION_DEFSYM,
34 OPTION_DEMANGLE,
35 OPTION_DYNAMIC_LINKER,
36 OPTION_NO_DYNAMIC_LINKER,
37 OPTION_SYSROOT,
38 OPTION_OUT_IMPLIB,
39 OPTION_EB,
40 OPTION_EL,
41 OPTION_EMBEDDED_RELOCS,
42 OPTION_EXPORT_DYNAMIC,
43 OPTION_NO_EXPORT_DYNAMIC,
44 OPTION_HELP,
45 OPTION_IGNORE,
46 OPTION_MAP,
47 OPTION_NO_DEMANGLE,
48 OPTION_NO_KEEP_MEMORY,
49 OPTION_NO_WARN_MISMATCH,
50 OPTION_NO_WARN_SEARCH_MISMATCH,
51 OPTION_NOINHIBIT_EXEC,
52 OPTION_NON_SHARED,
53 OPTION_NO_WHOLE_ARCHIVE,
54 OPTION_OFORMAT,
55 OPTION_RELAX,
56 OPTION_NO_RELAX,
57 OPTION_RETAIN_SYMBOLS_FILE,
58 OPTION_RPATH,
59 OPTION_RPATH_LINK,
60 OPTION_SHARED,
61 OPTION_SONAME,
62 OPTION_SORT_COMMON,
63 OPTION_SORT_SECTION,
64 OPTION_STATS,
65 OPTION_SYMBOLIC,
66 OPTION_SYMBOLIC_FUNCTIONS,
67 OPTION_TASK_LINK,
68 OPTION_TBSS,
69 OPTION_TDATA,
70 OPTION_TTEXT,
71 OPTION_TTEXT_SEGMENT,
72 OPTION_TRODATA_SEGMENT,
73 OPTION_TLDATA_SEGMENT,
74 OPTION_TRADITIONAL_FORMAT,
75 OPTION_UR,
76 OPTION_VERBOSE,
77 OPTION_VERSION,
78 OPTION_VERSION_SCRIPT,
79 OPTION_VERSION_EXPORTS_SECTION,
80 OPTION_DYNAMIC_LIST,
81 OPTION_DYNAMIC_LIST_CPP_NEW,
82 OPTION_DYNAMIC_LIST_CPP_TYPEINFO,
83 OPTION_DYNAMIC_LIST_DATA,
84 OPTION_EXPORT_DYNAMIC_SYMBOL,
85 OPTION_EXPORT_DYNAMIC_SYMBOL_LIST,
86 OPTION_WARN_COMMON,
87 OPTION_WARN_CONSTRUCTORS,
88 OPTION_WARN_FATAL,
89 OPTION_NO_WARN_FATAL,
90 OPTION_WARN_MULTIPLE_GP,
91 OPTION_WARN_ONCE,
92 OPTION_WARN_SECTION_ALIGN,
93 OPTION_SPLIT_BY_RELOC,
94 OPTION_SPLIT_BY_FILE ,
95 OPTION_WHOLE_ARCHIVE,
96 OPTION_ADD_DT_NEEDED_FOR_DYNAMIC,
97 OPTION_NO_ADD_DT_NEEDED_FOR_DYNAMIC,
98 OPTION_ADD_DT_NEEDED_FOR_REGULAR,
99 OPTION_NO_ADD_DT_NEEDED_FOR_REGULAR,
100 OPTION_WRAP,
101 OPTION_FORCE_EXE_SUFFIX,
102 OPTION_GC_SECTIONS,
103 OPTION_NO_GC_SECTIONS,
104 OPTION_PRINT_GC_SECTIONS,
105 OPTION_NO_PRINT_GC_SECTIONS,
106 OPTION_GC_KEEP_EXPORTED,
107 OPTION_HASH_SIZE,
108 OPTION_CHECK_SECTIONS,
109 OPTION_NO_CHECK_SECTIONS,
110 OPTION_NO_UNDEFINED,
111 OPTION_INIT,
112 OPTION_FINI,
113 OPTION_SECTION_START,
114 OPTION_UNIQUE,
115 OPTION_TARGET_HELP,
116 OPTION_ALLOW_SHLIB_UNDEFINED,
117 OPTION_NO_ALLOW_SHLIB_UNDEFINED,
118 OPTION_ALLOW_MULTIPLE_DEFINITION,
119 OPTION_NO_UNDEFINED_VERSION,
120 OPTION_DEFAULT_SYMVER,
121 OPTION_DEFAULT_IMPORTED_SYMVER,
122 OPTION_DISCARD_NONE,
123 OPTION_SPARE_DYNAMIC_TAGS,
124 OPTION_NO_DEFINE_COMMON,
125 OPTION_NOSTDLIB,
126 OPTION_NO_OMAGIC,
127 OPTION_STRIP_DISCARDED,
128 OPTION_NO_STRIP_DISCARDED,
129 OPTION_ACCEPT_UNKNOWN_INPUT_ARCH,
130 OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH,
131 OPTION_PIE,
132 OPTION_UNRESOLVED_SYMBOLS,
133 OPTION_WARN_UNRESOLVED_SYMBOLS,
134 OPTION_ERROR_UNRESOLVED_SYMBOLS,
135 OPTION_WARN_TEXTREL,
136 OPTION_WARN_ALTERNATE_EM,
137 OPTION_REDUCE_MEMORY_OVERHEADS,
138 #ifdef ENABLE_PLUGINS
139 OPTION_PLUGIN,
140 OPTION_PLUGIN_OPT,
141 #endif /* ENABLE_PLUGINS */
142 OPTION_DEFAULT_SCRIPT,
143 OPTION_PRINT_OUTPUT_FORMAT,
144 OPTION_PRINT_SYSROOT,
145 OPTION_IGNORE_UNRESOLVED_SYMBOL,
146 OPTION_PUSH_STATE,
147 OPTION_POP_STATE,
148 OPTION_DISABLE_MULTIPLE_DEFS_ABS,
149 OPTION_PRINT_MEMORY_USAGE,
150 OPTION_REQUIRE_DEFINED_SYMBOL,
151 OPTION_ORPHAN_HANDLING,
152 OPTION_FORCE_GROUP_ALLOCATION,
153 OPTION_PRINT_MAP_DISCARDED,
154 OPTION_NO_PRINT_MAP_DISCARDED,
155 OPTION_NON_CONTIGUOUS_REGIONS,
156 OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS,
157 };
158
159 /* The initial parser states. */
160 typedef enum input_enum {
161 input_selected, /* We've set the initial state. */
162 input_script,
163 input_mri_script,
164 input_version_script,
165 input_dynamic_list,
166 input_defsym
167 } input_type;
168
169 extern input_type parser_input;
170
171 extern unsigned int lineno;
172 extern const char *lex_string;
173
174 /* In ldlex.l. */
175 extern int yylex (void);
176 extern void lex_push_file (FILE *, const char *, unsigned int);
177 extern void lex_redirect (const char *, const char *, unsigned int);
178 extern void ldlex_script (void);
179 extern void ldlex_inputlist (void);
180 extern void ldlex_mri_script (void);
181 extern void ldlex_version_script (void);
182 extern void ldlex_version_file (void);
183 extern void ldlex_defsym (void);
184 extern void ldlex_expression (void);
185 extern void ldlex_both (void);
186 extern void ldlex_popstate (void);
187 extern const char* ldlex_filename (void);
188
189 /* In lexsup.c. */
190 extern int lex_input (void);
191 extern void lex_unput (int);
192 extern void parse_args (unsigned, char **);
193
194 #endif
This page took 0.033169 seconds and 3 git commands to generate.