[Aarch64] Add Binutils support for MEC
[binutils-gdb.git] / ld / ldlex.h
blob0538f0a06a1e5ad061966373dd753ef2ebcd6e02
1 /* ldlex.h -
2 Copyright (C) 1991-2023 Free Software Foundation, Inc.
4 This file is part of the GNU Binutils.
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.
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.
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. */
21 #ifndef LDLEX_H
22 #define LDLEX_H
24 #include <stdio.h>
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
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_NO_SYMBOLIC,
58 OPTION_RETAIN_SYMBOLS_FILE,
59 OPTION_RPATH,
60 OPTION_RPATH_LINK,
61 OPTION_SHARED,
62 OPTION_SONAME,
63 OPTION_SORT_COMMON,
64 OPTION_SORT_SECTION,
65 OPTION_STATS,
66 OPTION_SYMBOLIC,
67 OPTION_SYMBOLIC_FUNCTIONS,
68 OPTION_TASK_LINK,
69 OPTION_TBSS,
70 OPTION_TDATA,
71 OPTION_TTEXT,
72 OPTION_TTEXT_SEGMENT,
73 OPTION_TRODATA_SEGMENT,
74 OPTION_TLDATA_SEGMENT,
75 OPTION_TRADITIONAL_FORMAT,
76 OPTION_UR,
77 OPTION_VERBOSE,
78 OPTION_VERSION,
79 OPTION_VERSION_SCRIPT,
80 OPTION_VERSION_EXPORTS_SECTION,
81 OPTION_DYNAMIC_LIST,
82 OPTION_DYNAMIC_LIST_CPP_NEW,
83 OPTION_DYNAMIC_LIST_CPP_TYPEINFO,
84 OPTION_DYNAMIC_LIST_DATA,
85 OPTION_EXPORT_DYNAMIC_SYMBOL,
86 OPTION_EXPORT_DYNAMIC_SYMBOL_LIST,
87 OPTION_WARN_COMMON,
88 OPTION_WARN_CONSTRUCTORS,
89 OPTION_WARN_FATAL,
90 OPTION_NO_WARN_FATAL,
91 OPTION_NO_WARNINGS,
92 OPTION_WARN_MULTIPLE_GP,
93 OPTION_WARN_ONCE,
94 OPTION_WARN_SECTION_ALIGN,
95 OPTION_SPLIT_BY_RELOC,
96 OPTION_SPLIT_BY_FILE ,
97 OPTION_WHOLE_ARCHIVE,
98 OPTION_ADD_DT_NEEDED_FOR_DYNAMIC,
99 OPTION_NO_ADD_DT_NEEDED_FOR_DYNAMIC,
100 OPTION_ADD_DT_NEEDED_FOR_REGULAR,
101 OPTION_NO_ADD_DT_NEEDED_FOR_REGULAR,
102 OPTION_WRAP,
103 OPTION_FORCE_EXE_SUFFIX,
104 OPTION_GC_SECTIONS,
105 OPTION_NO_GC_SECTIONS,
106 OPTION_PRINT_GC_SECTIONS,
107 OPTION_NO_PRINT_GC_SECTIONS,
108 OPTION_GC_KEEP_EXPORTED,
109 OPTION_HASH_SIZE,
110 OPTION_CHECK_SECTIONS,
111 OPTION_NO_CHECK_SECTIONS,
112 OPTION_NO_UNDEFINED,
113 OPTION_INIT,
114 OPTION_FINI,
115 OPTION_SECTION_START,
116 OPTION_UNIQUE,
117 OPTION_TARGET_HELP,
118 OPTION_ALLOW_SHLIB_UNDEFINED,
119 OPTION_NO_ALLOW_SHLIB_UNDEFINED,
120 OPTION_ALLOW_MULTIPLE_DEFINITION,
121 #if SUPPORT_ERROR_HANDLING_SCRIPT
122 OPTION_ERROR_HANDLING_SCRIPT,
123 #endif
124 OPTION_UNDEFINED_VERSION,
125 OPTION_NO_UNDEFINED_VERSION,
126 OPTION_DEFAULT_SYMVER,
127 OPTION_DEFAULT_IMPORTED_SYMVER,
128 OPTION_DISCARD_NONE,
129 OPTION_SPARE_DYNAMIC_TAGS,
130 OPTION_NO_DEFINE_COMMON,
131 OPTION_NOSTDLIB,
132 OPTION_NO_OMAGIC,
133 OPTION_STRIP_DISCARDED,
134 OPTION_NO_STRIP_DISCARDED,
135 OPTION_ACCEPT_UNKNOWN_INPUT_ARCH,
136 OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH,
137 OPTION_PIE,
138 OPTION_NO_PIE,
139 OPTION_UNRESOLVED_SYMBOLS,
140 OPTION_WARN_UNRESOLVED_SYMBOLS,
141 OPTION_ERROR_UNRESOLVED_SYMBOLS,
142 OPTION_WARN_TEXTREL,
143 OPTION_WARN_ALTERNATE_EM,
144 OPTION_REDUCE_MEMORY_OVERHEADS,
145 OPTION_MAX_CACHE_SIZE,
146 #if BFD_SUPPORTS_PLUGINS
147 OPTION_PLUGIN,
148 OPTION_PLUGIN_OPT,
149 #endif /* BFD_SUPPORTS_PLUGINS */
150 OPTION_DEFAULT_SCRIPT,
151 OPTION_PRINT_OUTPUT_FORMAT,
152 OPTION_PRINT_SYSROOT,
153 OPTION_IGNORE_UNRESOLVED_SYMBOL,
154 OPTION_PUSH_STATE,
155 OPTION_POP_STATE,
156 OPTION_DISABLE_MULTIPLE_DEFS_ABS,
157 OPTION_PRINT_MEMORY_USAGE,
158 OPTION_REQUIRE_DEFINED_SYMBOL,
159 OPTION_ORPHAN_HANDLING,
160 OPTION_FORCE_GROUP_ALLOCATION,
161 OPTION_PRINT_MAP_DISCARDED,
162 OPTION_NO_PRINT_MAP_DISCARDED,
163 OPTION_NON_CONTIGUOUS_REGIONS,
164 OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS,
165 OPTION_DEPENDENCY_FILE,
166 OPTION_CTF_VARIABLES,
167 OPTION_NO_CTF_VARIABLES,
168 OPTION_CTF_SHARE_TYPES,
169 OPTION_WARN_EXECSTACK,
170 OPTION_NO_WARN_EXECSTACK,
171 OPTION_WARN_RWX_SEGMENTS,
172 OPTION_NO_WARN_RWX_SEGMENTS,
175 /* The initial parser states. */
176 typedef enum input_enum
178 input_selected, /* We've set the initial state. */
179 input_script,
180 input_mri_script,
181 input_version_script,
182 input_dynamic_list,
183 input_defsym
184 } input_type;
186 extern input_type parser_input;
188 extern unsigned int lineno;
189 extern const char *lex_string;
191 /* In ldlex.l. */
192 extern int yylex (void);
193 extern void lex_push_file (FILE *, const char *, unsigned int);
194 extern void lex_redirect (const char *, const char *, unsigned int);
195 extern void ldlex_script (void);
196 extern void ldlex_inputlist (void);
197 extern void ldlex_mri_script (void);
198 extern void ldlex_version_script (void);
199 extern void ldlex_version_file (void);
200 extern void ldlex_expression (void);
201 extern void ldlex_wild (void);
202 extern void ldlex_popstate (void);
203 extern void ldlex_backup (void);
204 extern const char* ldlex_filename (void);
206 /* In lexsup.c. */
207 extern int lex_input (void);
208 extern void lex_unput (int);
209 extern void parse_args (unsigned, char **);
211 #endif