Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* ldlang.h - linker command language support |
82704155 | 2 | Copyright (C) 1991-2019 Free Software Foundation, Inc. |
5cc18311 | 3 | |
f96b4a7b | 4 | This file is part of the GNU Binutils. |
5cc18311 | 5 | |
f96b4a7b | 6 | This program is free software; you can redistribute it and/or modify |
252b5132 | 7 | it under the terms of the GNU General Public License as published by |
f96b4a7b NC |
8 | the Free Software Foundation; either version 3 of the License, or |
9 | (at your option) any later version. | |
5cc18311 | 10 | |
f96b4a7b | 11 | This program is distributed in the hope that it will be useful, |
252b5132 RH |
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. | |
5cc18311 | 15 | |
252b5132 | 16 | You should have received a copy of the GNU General Public License |
f96b4a7b NC |
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. */ | |
252b5132 RH |
20 | |
21 | #ifndef LDLANG_H | |
22 | #define LDLANG_H | |
23 | ||
a747ee4d NC |
24 | #define DEFAULT_MEMORY_REGION "*default*" |
25 | ||
6bdafbeb NC |
26 | typedef enum |
27 | { | |
252b5132 RH |
28 | lang_input_file_is_l_enum, |
29 | lang_input_file_is_symbols_only_enum, | |
30 | lang_input_file_is_marker_enum, | |
31 | lang_input_file_is_fake_enum, | |
32 | lang_input_file_is_search_file_enum, | |
33 | lang_input_file_is_file_enum | |
34 | } lang_input_file_enum_type; | |
35 | ||
6bdafbeb NC |
36 | struct _fill_type |
37 | { | |
2c382fb6 AM |
38 | size_t size; |
39 | unsigned char data[1]; | |
40 | }; | |
89cdebba | 41 | |
6bdafbeb NC |
42 | typedef struct statement_list |
43 | { | |
4a93e180 NC |
44 | union lang_statement_union * head; |
45 | union lang_statement_union ** tail; | |
252b5132 RH |
46 | } lang_statement_list_type; |
47 | ||
4a93e180 NC |
48 | typedef struct memory_region_name_struct |
49 | { | |
50 | const char * name; | |
51 | struct memory_region_name_struct * next; | |
52 | } lang_memory_region_name; | |
53 | ||
6bdafbeb NC |
54 | typedef struct memory_region_struct |
55 | { | |
4a93e180 | 56 | lang_memory_region_name name_list; |
252b5132 | 57 | struct memory_region_struct *next; |
cc9ad334 | 58 | union etree_union *origin_exp; |
252b5132 RH |
59 | bfd_vma origin; |
60 | bfd_size_type length; | |
cc9ad334 | 61 | union etree_union *length_exp; |
252b5132 | 62 | bfd_vma current; |
66e28d60 | 63 | union lang_statement_union *last_os; |
252b5132 RH |
64 | flagword flags; |
65 | flagword not_flags; | |
b34976b6 | 66 | bfd_boolean had_full_message; |
89cdebba KH |
67 | } lang_memory_region_type; |
68 | ||
1e9cc1c2 NC |
69 | enum statement_enum |
70 | { | |
71 | lang_output_section_statement_enum, | |
72 | lang_assignment_statement_enum, | |
73 | lang_input_statement_enum, | |
74 | lang_address_statement_enum, | |
75 | lang_wild_statement_enum, | |
76 | lang_input_section_enum, | |
77 | lang_object_symbols_statement_enum, | |
78 | lang_fill_statement_enum, | |
79 | lang_data_statement_enum, | |
80 | lang_reloc_statement_enum, | |
81 | lang_target_statement_enum, | |
82 | lang_output_statement_enum, | |
83 | lang_padding_statement_enum, | |
84 | lang_group_statement_enum, | |
85 | lang_insert_statement_enum, | |
86 | lang_constructors_statement_enum | |
87 | }; | |
88 | ||
6bdafbeb NC |
89 | typedef struct lang_statement_header_struct |
90 | { | |
e368bf56 | 91 | /* Next pointer for statement_list statement list. */ |
89cdebba | 92 | union lang_statement_union *next; |
1e9cc1c2 | 93 | enum statement_enum type; |
252b5132 RH |
94 | } lang_statement_header_type; |
95 | ||
6bdafbeb NC |
96 | typedef struct |
97 | { | |
252b5132 RH |
98 | lang_statement_header_type header; |
99 | union etree_union *exp; | |
100 | } lang_assignment_statement_type; | |
101 | ||
6bdafbeb NC |
102 | typedef struct lang_target_statement_struct |
103 | { | |
252b5132 RH |
104 | lang_statement_header_type header; |
105 | const char *target; | |
106 | } lang_target_statement_type; | |
107 | ||
6bdafbeb NC |
108 | typedef struct lang_output_statement_struct |
109 | { | |
252b5132 RH |
110 | lang_statement_header_type header; |
111 | const char *name; | |
112 | } lang_output_statement_type; | |
113 | ||
114 | /* Section types specified in a linker script. */ | |
115 | ||
6bdafbeb NC |
116 | enum section_type |
117 | { | |
252b5132 | 118 | normal_section, |
7b243801 | 119 | first_overlay_section, |
152d792f | 120 | overlay_section, |
252b5132 | 121 | noload_section, |
02a38f92 | 122 | noalloc_section |
252b5132 RH |
123 | }; |
124 | ||
6bdafbeb NC |
125 | /* This structure holds a list of program headers describing |
126 | segments in which this section should be placed. */ | |
252b5132 | 127 | |
6bdafbeb NC |
128 | typedef struct lang_output_section_phdr_list |
129 | { | |
252b5132 RH |
130 | struct lang_output_section_phdr_list *next; |
131 | const char *name; | |
b34976b6 | 132 | bfd_boolean used; |
6bdafbeb | 133 | } lang_output_section_phdr_list; |
252b5132 | 134 | |
6bdafbeb NC |
135 | typedef struct lang_output_section_statement_struct |
136 | { | |
252b5132 | 137 | lang_statement_header_type header; |
252b5132 | 138 | lang_statement_list_type children; |
afd7a018 | 139 | struct lang_output_section_statement_struct *next; |
218868ba | 140 | struct lang_output_section_statement_struct *prev; |
252b5132 | 141 | const char *name; |
252b5132 | 142 | asection *bfd_section; |
6bdafbeb NC |
143 | lang_memory_region_type *region; |
144 | lang_memory_region_type *lma_region; | |
2c382fb6 | 145 | fill_type *fill; |
7fabd029 | 146 | union etree_union *addr_tree; |
252b5132 | 147 | union etree_union *load_base; |
3d9c8f6b AM |
148 | union etree_union *section_alignment; |
149 | union etree_union *subsection_alignment; | |
252b5132 | 150 | |
9f88b410 RS |
151 | /* If non-null, an expression to evaluate after setting the section's |
152 | size. The expression is evaluated inside REGION (above) with '.' | |
153 | set to the end of the section. Used in the last overlay section | |
154 | to move '.' past all the overlaid sections. */ | |
155 | union etree_union *update_dot_tree; | |
156 | ||
6bdafbeb | 157 | lang_output_section_phdr_list *phdrs; |
7fabd029 AM |
158 | |
159 | unsigned int block_value; | |
7fabd029 AM |
160 | int constraint; |
161 | flagword flags; | |
162 | enum section_type sectype; | |
cde9e0be AM |
163 | unsigned int processed_vma : 1; |
164 | unsigned int processed_lma : 1; | |
7fabd029 | 165 | unsigned int all_input_readonly : 1; |
49c13adb | 166 | /* If this section should be ignored. */ |
e4492aa0 | 167 | unsigned int ignored : 1; |
6d8bf25d | 168 | /* If this section should update "dot". Prevents section being ignored. */ |
e4492aa0 | 169 | unsigned int update_dot : 1; |
d2667025 AM |
170 | /* If this section is after assignment to _end. */ |
171 | unsigned int after_end : 1; | |
1eec346e NC |
172 | /* If this section uses the alignment of its input sections. */ |
173 | unsigned int align_lma_with_input : 1; | |
252b5132 RH |
174 | } lang_output_section_statement_type; |
175 | ||
6bdafbeb NC |
176 | typedef struct |
177 | { | |
252b5132 RH |
178 | lang_statement_header_type header; |
179 | } lang_common_statement_type; | |
180 | ||
6bdafbeb NC |
181 | typedef struct |
182 | { | |
252b5132 RH |
183 | lang_statement_header_type header; |
184 | } lang_object_symbols_statement_type; | |
185 | ||
6bdafbeb NC |
186 | typedef struct |
187 | { | |
252b5132 | 188 | lang_statement_header_type header; |
2c382fb6 | 189 | fill_type *fill; |
252b5132 RH |
190 | int size; |
191 | asection *output_section; | |
192 | } lang_fill_statement_type; | |
193 | ||
6bdafbeb NC |
194 | typedef struct |
195 | { | |
252b5132 RH |
196 | lang_statement_header_type header; |
197 | unsigned int type; | |
89cdebba | 198 | union etree_union *exp; |
252b5132 RH |
199 | bfd_vma value; |
200 | asection *output_section; | |
7fabd029 | 201 | bfd_vma output_offset; |
252b5132 RH |
202 | } lang_data_statement_type; |
203 | ||
204 | /* Generate a reloc in the output file. */ | |
205 | ||
6bdafbeb NC |
206 | typedef struct |
207 | { | |
252b5132 RH |
208 | lang_statement_header_type header; |
209 | ||
210 | /* Reloc to generate. */ | |
211 | bfd_reloc_code_real_type reloc; | |
212 | ||
213 | /* Reloc howto structure. */ | |
214 | reloc_howto_type *howto; | |
215 | ||
6bdafbeb NC |
216 | /* Section to generate reloc against. |
217 | Exactly one of section and name must be NULL. */ | |
252b5132 RH |
218 | asection *section; |
219 | ||
6bdafbeb NC |
220 | /* Name of symbol to generate reloc against. |
221 | Exactly one of section and name must be NULL. */ | |
252b5132 RH |
222 | const char *name; |
223 | ||
224 | /* Expression for addend. */ | |
225 | union etree_union *addend_exp; | |
226 | ||
227 | /* Resolved addend. */ | |
228 | bfd_vma addend_value; | |
229 | ||
230 | /* Output section where reloc should be performed. */ | |
231 | asection *output_section; | |
232 | ||
7fabd029 AM |
233 | /* Offset within output section. */ |
234 | bfd_vma output_offset; | |
252b5132 RH |
235 | } lang_reloc_statement_type; |
236 | ||
66be1055 | 237 | struct lang_input_statement_flags |
6bdafbeb | 238 | { |
66be1055 | 239 | /* 1 means this file was specified in a -l option. */ |
b7f95647 | 240 | unsigned int maybe_archive : 1; |
5cc18311 | 241 | |
d4ae5fb0 AM |
242 | /* 1 means this file was specified in a -l:namespec option. */ |
243 | unsigned int full_name_provided : 1; | |
244 | ||
252b5132 | 245 | /* 1 means search a set of directories for this file. */ |
66be1055 | 246 | unsigned int search_dirs : 1; |
5cc18311 | 247 | |
f4a23d42 | 248 | /* 1 means this was found when processing a script in the sysroot. */ |
409d7240 | 249 | unsigned int sysrooted : 1; |
e3f2db7f | 250 | |
252b5132 RH |
251 | /* 1 means this is base file of incremental load. |
252 | Do not load this file's text or data. | |
5cc18311 | 253 | Also default text_start to after this file's bss. */ |
66be1055 | 254 | unsigned int just_syms : 1; |
252b5132 RH |
255 | |
256 | /* Whether to search for this entry as a dynamic archive. */ | |
409d7240 | 257 | unsigned int dynamic : 1; |
252b5132 | 258 | |
15fc2e13 AM |
259 | /* Set if a DT_NEEDED tag should be added not just for the dynamic library |
260 | explicitly given by this entry but also for any dynamic libraries in | |
261 | this entry's needed list. */ | |
ddbb8a31 | 262 | unsigned int add_DT_NEEDED_for_dynamic : 1; |
e56f61be | 263 | |
15fc2e13 AM |
264 | /* Set if this entry should cause a DT_NEEDED tag only when some |
265 | regular file references its symbols (ie. --as-needed is in effect). */ | |
ddbb8a31 | 266 | unsigned int add_DT_NEEDED_for_regular : 1; |
4a43e768 | 267 | |
252b5132 | 268 | /* Whether to include the entire contents of an archive. */ |
409d7240 | 269 | unsigned int whole_archive : 1; |
252b5132 | 270 | |
c4b78195 | 271 | /* Set when bfd opening is successful. */ |
409d7240 | 272 | unsigned int loaded : 1; |
5cc18311 | 273 | |
409d7240 | 274 | unsigned int real : 1; |
c4b78195 NC |
275 | |
276 | /* Set if the file does not exist. */ | |
277 | unsigned int missing_file : 1; | |
5d3236ee | 278 | |
e77620a5 AM |
279 | /* Set if reloading an archive or --as-needed lib. */ |
280 | unsigned int reload : 1; | |
281 | ||
8543fde5 | 282 | #ifdef ENABLE_PLUGINS |
5d3236ee DK |
283 | /* Set if the file was claimed by a plugin. */ |
284 | unsigned int claimed : 1; | |
285 | ||
8543fde5 DK |
286 | /* Set if the file was claimed from an archive. */ |
287 | unsigned int claim_archive : 1; | |
ce875075 AM |
288 | |
289 | /* Set if added by the lto plugin add_input_file callback. */ | |
290 | unsigned int lto_output : 1; | |
8543fde5 | 291 | #endif /* ENABLE_PLUGINS */ |
26278bb8 UD |
292 | |
293 | /* Head of list of pushed flags. */ | |
294 | struct lang_input_statement_flags *pushed; | |
66be1055 AM |
295 | }; |
296 | ||
297 | typedef struct lang_input_statement_struct | |
298 | { | |
299 | lang_statement_header_type header; | |
300 | /* Name of this file. */ | |
301 | const char *filename; | |
302 | /* Name to use for the symbol giving address of text start. | |
303 | Usually the same as filename, but for a file spec'd with | |
304 | -l this is the -l switch itself rather than the filename. */ | |
305 | const char *local_sym_name; | |
306 | ||
307 | bfd *the_bfd; | |
308 | ||
309 | struct flag_info *section_flag_list; | |
310 | ||
e368bf56 | 311 | /* Next pointer for file_chain statement list. */ |
66be1055 AM |
312 | union lang_statement_union *next; |
313 | ||
e368bf56 | 314 | /* Next pointer for input_file_chain statement list. */ |
66be1055 AM |
315 | union lang_statement_union *next_real_file; |
316 | ||
317 | const char *target; | |
8543fde5 | 318 | |
66be1055 | 319 | struct lang_input_statement_flags flags; |
252b5132 RH |
320 | } lang_input_statement_type; |
321 | ||
6bdafbeb NC |
322 | typedef struct |
323 | { | |
252b5132 RH |
324 | lang_statement_header_type header; |
325 | asection *section; | |
5cc18311 | 326 | } lang_input_section_type; |
252b5132 | 327 | |
7dd9c6eb AM |
328 | struct map_symbol_def { |
329 | struct bfd_link_hash_entry *entry; | |
330 | struct map_symbol_def *next; | |
331 | }; | |
332 | ||
6fcc66ab AM |
333 | /* For input sections, when writing a map file: head / tail of a linked |
334 | list of hash table entries for symbols defined in this section. */ | |
335 | typedef struct input_section_userdata_struct | |
336 | { | |
337 | struct map_symbol_def *map_symbol_def_head; | |
338 | struct map_symbol_def **map_symbol_def_tail; | |
339 | unsigned long map_symbol_def_count; | |
340 | } input_section_userdata_type; | |
341 | ||
342 | #define get_userdata(x) ((x)->userdata) | |
343 | ||
344 | ||
72223188 JJ |
345 | typedef struct lang_wild_statement_struct lang_wild_statement_type; |
346 | ||
347 | typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, | |
b9c361e0 JL |
348 | asection *, struct flag_info *, |
349 | lang_input_statement_type *, void *); | |
72223188 JJ |
350 | |
351 | typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, | |
352 | lang_input_statement_type *, | |
353 | callback_t callback, | |
354 | void *data); | |
355 | ||
390fbbf1 AM |
356 | typedef bfd_boolean (*lang_match_sec_type_func) (bfd *, const asection *, |
357 | bfd *, const asection *); | |
358 | ||
e6f2cbf5 L |
359 | /* Binary search tree structure to efficiently sort sections by |
360 | name. */ | |
361 | typedef struct lang_section_bst | |
362 | { | |
363 | asection *section; | |
364 | struct lang_section_bst *left; | |
365 | struct lang_section_bst *right; | |
366 | } lang_section_bst_type; | |
367 | ||
72223188 | 368 | struct lang_wild_statement_struct |
6bdafbeb | 369 | { |
252b5132 | 370 | lang_statement_header_type header; |
252b5132 | 371 | const char *filename; |
b34976b6 | 372 | bfd_boolean filenames_sorted; |
b6bf44ba | 373 | struct wildcard_list *section_list; |
b34976b6 | 374 | bfd_boolean keep_sections; |
252b5132 | 375 | lang_statement_list_type children; |
8f1732fc | 376 | struct name_list *exclude_name_list; |
72223188 JJ |
377 | |
378 | walk_wild_section_handler_t walk_wild_section_handler; | |
379 | struct wildcard_list *handler_data[4]; | |
e6f2cbf5 | 380 | lang_section_bst_type *tree; |
ae17ab41 | 381 | struct flag_info *section_flag_list; |
72223188 | 382 | }; |
252b5132 | 383 | |
6bdafbeb NC |
384 | typedef struct lang_address_statement_struct |
385 | { | |
252b5132 | 386 | lang_statement_header_type header; |
89cdebba KH |
387 | const char *section_name; |
388 | union etree_union *address; | |
ba916c8a | 389 | const segment_type *segment; |
252b5132 RH |
390 | } lang_address_statement_type; |
391 | ||
6bdafbeb NC |
392 | typedef struct |
393 | { | |
252b5132 RH |
394 | lang_statement_header_type header; |
395 | bfd_vma output_offset; | |
1a69ff95 | 396 | bfd_size_type size; |
252b5132 | 397 | asection *output_section; |
2c382fb6 | 398 | fill_type *fill; |
252b5132 RH |
399 | } lang_padding_statement_type; |
400 | ||
401 | /* A group statement collects a set of libraries together. The | |
402 | libraries are searched multiple times, until no new undefined | |
403 | symbols are found. The effect is to search a group of libraries as | |
404 | though they were a single library. */ | |
405 | ||
6bdafbeb NC |
406 | typedef struct |
407 | { | |
252b5132 RH |
408 | lang_statement_header_type header; |
409 | lang_statement_list_type children; | |
410 | } lang_group_statement_type; | |
411 | ||
53d25da6 AM |
412 | typedef struct |
413 | { | |
414 | lang_statement_header_type header; | |
415 | const char *where; | |
416 | bfd_boolean is_before; | |
417 | } lang_insert_statement_type; | |
418 | ||
6bdafbeb NC |
419 | typedef union lang_statement_union |
420 | { | |
252b5132 | 421 | lang_statement_header_type header; |
252b5132 RH |
422 | lang_wild_statement_type wild_statement; |
423 | lang_data_statement_type data_statement; | |
424 | lang_reloc_statement_type reloc_statement; | |
425 | lang_address_statement_type address_statement; | |
426 | lang_output_section_statement_type output_section_statement; | |
252b5132 RH |
427 | lang_assignment_statement_type assignment_statement; |
428 | lang_input_statement_type input_statement; | |
429 | lang_target_statement_type target_statement; | |
430 | lang_output_statement_type output_statement; | |
431 | lang_input_section_type input_section; | |
432 | lang_common_statement_type common_statement; | |
433 | lang_object_symbols_statement_type object_symbols_statement; | |
434 | lang_fill_statement_type fill_statement; | |
435 | lang_padding_statement_type padding_statement; | |
436 | lang_group_statement_type group_statement; | |
53d25da6 | 437 | lang_insert_statement_type insert_statement; |
252b5132 RH |
438 | } lang_statement_union_type; |
439 | ||
440 | /* This structure holds information about a program header, from the | |
441 | PHDRS command in the linker script. */ | |
442 | ||
6bdafbeb NC |
443 | struct lang_phdr |
444 | { | |
252b5132 RH |
445 | struct lang_phdr *next; |
446 | const char *name; | |
447 | unsigned long type; | |
b34976b6 AM |
448 | bfd_boolean filehdr; |
449 | bfd_boolean phdrs; | |
252b5132 RH |
450 | etree_type *at; |
451 | etree_type *flags; | |
452 | }; | |
453 | ||
454 | /* This structure is used to hold a list of sections which may not | |
455 | cross reference each other. */ | |
456 | ||
6bdafbeb NC |
457 | typedef struct lang_nocrossref |
458 | { | |
252b5132 RH |
459 | struct lang_nocrossref *next; |
460 | const char *name; | |
6bdafbeb | 461 | } lang_nocrossref_type; |
252b5132 RH |
462 | |
463 | /* The list of nocrossref lists. */ | |
464 | ||
6bdafbeb NC |
465 | struct lang_nocrossrefs |
466 | { | |
252b5132 | 467 | struct lang_nocrossrefs *next; |
6bdafbeb | 468 | lang_nocrossref_type *list; |
cdf96953 | 469 | bfd_boolean onlyfirst; |
252b5132 RH |
470 | }; |
471 | ||
577a0623 AM |
472 | /* This structure is used to hold a list of input section names which |
473 | will not match an output section in the linker script. */ | |
474 | ||
6bdafbeb NC |
475 | struct unique_sections |
476 | { | |
577a0623 AM |
477 | struct unique_sections *next; |
478 | const char *name; | |
479 | }; | |
480 | ||
afd7a018 AM |
481 | /* Used by place_orphan to keep track of orphan sections and statements. */ |
482 | ||
4a93e180 NC |
483 | struct orphan_save |
484 | { | |
afd7a018 AM |
485 | const char *name; |
486 | flagword flags; | |
487 | lang_output_section_statement_type *os; | |
488 | asection **section; | |
489 | lang_statement_union_type **stmt; | |
490 | lang_output_section_statement_type **os_tail; | |
491 | }; | |
492 | ||
16e4ecc0 AM |
493 | struct asneeded_minfo |
494 | { | |
495 | struct asneeded_minfo *next; | |
496 | const char *soname; | |
497 | bfd *ref; | |
498 | const char *name; | |
499 | }; | |
500 | ||
66be1055 AM |
501 | extern struct lang_phdr *lang_phdr_list; |
502 | extern struct lang_nocrossrefs *nocrossref_list; | |
8be573a7 | 503 | extern const char *output_target; |
252b5132 | 504 | extern lang_output_section_statement_type *abs_output_section; |
aea4bd9d | 505 | extern lang_statement_list_type lang_output_section_statement; |
66be1055 | 506 | extern struct lang_input_statement_flags input_flags; |
b34976b6 | 507 | extern bfd_boolean lang_has_input_file; |
252b5132 | 508 | extern lang_statement_list_type *stat_ptr; |
b34976b6 | 509 | extern bfd_boolean delete_output_file_on_failure; |
252b5132 | 510 | |
e3e942e9 | 511 | extern struct bfd_sym_chain entry_symbol; |
1e281515 | 512 | extern const char *entry_section; |
b34976b6 | 513 | extern bfd_boolean entry_from_cmdline; |
b71e2778 | 514 | extern lang_statement_list_type file_chain; |
dc27aea4 | 515 | extern lang_statement_list_type input_file_chain; |
252b5132 | 516 | |
420e579c | 517 | extern int lang_statement_iteration; |
16e4ecc0 | 518 | extern struct asneeded_minfo **asneeded_list_tail; |
420e579c | 519 | |
eae25ec5 HPN |
520 | extern void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *); |
521 | ||
f53154de | 522 | extern void lang_init |
1579bae1 | 523 | (void); |
750877ba L |
524 | extern void lang_finish |
525 | (void); | |
4a93e180 NC |
526 | extern lang_memory_region_type * lang_memory_region_lookup |
527 | (const char * const, bfd_boolean); | |
528 | extern void lang_memory_region_alias | |
529 | (const char *, const char *); | |
f53154de | 530 | extern void lang_map |
1579bae1 | 531 | (void); |
f53154de | 532 | extern void lang_set_flags |
1579bae1 | 533 | (lang_memory_region_type *, const char *, int); |
f53154de | 534 | extern void lang_add_output |
1579bae1 | 535 | (const char *, int from_script); |
aea4bd9d | 536 | extern lang_output_section_statement_type *lang_enter_output_section_statement |
1eec346e NC |
537 | (const char *, etree_type *, enum section_type, etree_type *, etree_type *, |
538 | etree_type *, int, int); | |
f53154de | 539 | extern void lang_final |
1579bae1 | 540 | (void); |
eaeb0a9d AM |
541 | extern void lang_relax_sections |
542 | (bfd_boolean); | |
f53154de | 543 | extern void lang_process |
1579bae1 | 544 | (void); |
f53154de | 545 | extern void lang_section_start |
ba916c8a | 546 | (const char *, union etree_union *, const segment_type *); |
f53154de | 547 | extern void lang_add_entry |
1579bae1 | 548 | (const char *, bfd_boolean); |
a359509e ZW |
549 | extern void lang_default_entry |
550 | (const char *); | |
f53154de | 551 | extern void lang_add_target |
1579bae1 | 552 | (const char *); |
252b5132 | 553 | extern void lang_add_wild |
1579bae1 | 554 | (struct wildcard_spec *, struct wildcard_list *, bfd_boolean); |
f53154de | 555 | extern void lang_add_map |
1579bae1 | 556 | (const char *); |
f53154de | 557 | extern void lang_add_fill |
1579bae1 AM |
558 | (fill_type *); |
559 | extern lang_assignment_statement_type *lang_add_assignment | |
560 | (union etree_union *); | |
f53154de | 561 | extern void lang_add_attribute |
1579bae1 | 562 | (enum statement_enum); |
f53154de | 563 | extern void lang_startup |
1579bae1 | 564 | (const char *); |
f53154de | 565 | extern void lang_float |
1579bae1 | 566 | (bfd_boolean); |
252b5132 | 567 | extern void lang_leave_output_section_statement |
6bdafbeb | 568 | (fill_type *, const char *, lang_output_section_phdr_list *, |
1579bae1 | 569 | const char *); |
f53154de | 570 | extern void lang_statement_append |
6bdafbeb NC |
571 | (lang_statement_list_type *, lang_statement_union_type *, |
572 | lang_statement_union_type **); | |
252b5132 | 573 | extern void lang_for_each_input_file |
1579bae1 | 574 | (void (*dothis) (lang_input_statement_type *)); |
252b5132 | 575 | extern void lang_for_each_file |
1579bae1 | 576 | (void (*dothis) (lang_input_statement_type *)); |
f53154de | 577 | extern void lang_reset_memory_regions |
1579bae1 | 578 | (void); |
f2241121 | 579 | extern void lang_do_assignments |
2f65ac72 | 580 | (lang_phase_type); |
d2667025 AM |
581 | extern asection *section_for_dot |
582 | (void); | |
252b5132 | 583 | |
f53154de AM |
584 | #define LANG_FOR_EACH_INPUT_STATEMENT(statement) \ |
585 | lang_input_statement_type *statement; \ | |
1fa4ec6a AM |
586 | for (statement = &file_chain.head->input_statement; \ |
587 | statement != NULL; \ | |
588 | statement = &statement->next->input_statement) | |
5cc18311 | 589 | |
66c103b7 AM |
590 | #define lang_output_section_find(NAME) \ |
591 | lang_output_section_statement_lookup (NAME, 0, FALSE) | |
592 | ||
f53154de | 593 | extern void lang_process |
1579bae1 | 594 | (void); |
f53154de | 595 | extern void ldlang_add_file |
1579bae1 | 596 | (lang_input_statement_type *); |
afd7a018 | 597 | extern lang_output_section_statement_type *lang_output_section_find_by_flags |
93638471 | 598 | (const asection *, flagword, lang_output_section_statement_type **, |
390fbbf1 | 599 | lang_match_sec_type_func); |
afd7a018 | 600 | extern lang_output_section_statement_type *lang_insert_orphan |
8a99a385 | 601 | (asection *, const char *, int, lang_output_section_statement_type *, |
7b986e99 | 602 | struct orphan_save *, etree_type *, lang_statement_list_type *); |
252b5132 | 603 | extern lang_input_statement_type *lang_add_input_file |
1579bae1 | 604 | (const char *, lang_input_file_enum_type, const char *); |
f53154de | 605 | extern void lang_add_keepsyms_file |
1579bae1 | 606 | (const char *); |
24ef1aa7 GM |
607 | extern lang_output_section_statement_type *lang_output_section_get |
608 | (const asection *); | |
66c103b7 | 609 | extern lang_output_section_statement_type *lang_output_section_statement_lookup |
d127ecce AM |
610 | (const char *, int, bfd_boolean); |
611 | extern lang_output_section_statement_type *next_matching_output_section_statement | |
612 | (lang_output_section_statement_type *, int); | |
f53154de | 613 | extern void ldlang_add_undef |
24898b70 | 614 | (const char *const, bfd_boolean); |
0a618243 AB |
615 | extern void ldlang_add_require_defined |
616 | (const char *const); | |
f53154de | 617 | extern void lang_add_output_format |
1579bae1 | 618 | (const char *, const char *, const char *, int); |
f53154de | 619 | extern void lang_list_init |
1579bae1 | 620 | (lang_statement_list_type *); |
bde18da4 AM |
621 | extern void push_stat_ptr |
622 | (lang_statement_list_type *); | |
623 | extern void pop_stat_ptr | |
624 | (void); | |
f53154de | 625 | extern void lang_add_data |
1579bae1 | 626 | (int type, union etree_union *); |
252b5132 | 627 | extern void lang_add_reloc |
1579bae1 AM |
628 | (bfd_reloc_code_real_type, reloc_howto_type *, asection *, const char *, |
629 | union etree_union *); | |
252b5132 | 630 | extern void lang_for_each_statement |
1579bae1 | 631 | (void (*) (lang_statement_union_type *)); |
8658f989 AM |
632 | extern void lang_for_each_statement_worker |
633 | (void (*) (lang_statement_union_type *), lang_statement_union_type *); | |
1579bae1 AM |
634 | extern void *stat_alloc |
635 | (size_t); | |
8423293d AM |
636 | extern void strip_excluded_output_sections |
637 | (void); | |
18cd5bce AM |
638 | extern void lang_clear_os_map |
639 | (void); | |
f53154de | 640 | extern void dprint_statement |
1579bae1 | 641 | (lang_statement_union_type *, int); |
e9ee469a AM |
642 | extern void lang_size_sections |
643 | (bfd_boolean *, bfd_boolean); | |
644 | extern void one_lang_size_sections_pass | |
645 | (bfd_boolean *, bfd_boolean); | |
53d25da6 AM |
646 | extern void lang_add_insert |
647 | (const char *, int); | |
f53154de | 648 | extern void lang_enter_group |
1579bae1 | 649 | (void); |
f53154de | 650 | extern void lang_leave_group |
1579bae1 | 651 | (void); |
39dcfe18 | 652 | extern void lang_add_section |
1579bae1 | 653 | (lang_statement_list_type *, asection *, |
b9c361e0 | 654 | struct flag_info *, lang_output_section_statement_type *); |
252b5132 | 655 | extern void lang_new_phdr |
1579bae1 AM |
656 | (const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *, |
657 | etree_type *); | |
f53154de | 658 | extern void lang_add_nocrossref |
6bdafbeb | 659 | (lang_nocrossref_type *); |
cdf96953 MF |
660 | extern void lang_add_nocrossref_to |
661 | (lang_nocrossref_type *); | |
f53154de | 662 | extern void lang_enter_overlay |
7e7d5768 | 663 | (etree_type *, etree_type *); |
f53154de | 664 | extern void lang_enter_overlay_section |
1579bae1 | 665 | (const char *); |
252b5132 | 666 | extern void lang_leave_overlay_section |
6bdafbeb | 667 | (fill_type *, lang_output_section_phdr_list *); |
252b5132 | 668 | extern void lang_leave_overlay |
1579bae1 | 669 | (etree_type *, int, fill_type *, const char *, |
6bdafbeb | 670 | lang_output_section_phdr_list *, const char *); |
252b5132 | 671 | |
313e35ee | 672 | extern struct bfd_elf_version_expr *lang_new_vers_pattern |
86043bbb | 673 | (struct bfd_elf_version_expr *, const char *, const char *, bfd_boolean); |
252b5132 | 674 | extern struct bfd_elf_version_tree *lang_new_vers_node |
1579bae1 | 675 | (struct bfd_elf_version_expr *, struct bfd_elf_version_expr *); |
252b5132 | 676 | extern struct bfd_elf_version_deps *lang_add_vers_depend |
1579bae1 | 677 | (struct bfd_elf_version_deps *, const char *); |
252b5132 | 678 | extern void lang_register_vers_node |
1579bae1 | 679 | (const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *); |
55255dae L |
680 | extern void lang_append_dynamic_list (struct bfd_elf_version_expr *); |
681 | extern void lang_append_dynamic_list_cpp_typeinfo (void); | |
40b36307 | 682 | extern void lang_append_dynamic_list_cpp_new (void); |
f53154de | 683 | extern void lang_add_unique |
1579bae1 | 684 | (const char *); |
f53154de | 685 | extern const char *lang_get_output_target |
1579bae1 | 686 | (void); |
b58f81ae | 687 | extern void add_excluded_libs (const char *); |
e9f53129 AM |
688 | extern bfd_boolean load_symbols |
689 | (lang_input_statement_type *, lang_statement_list_type *); | |
b58f81ae | 690 | |
2889e75b NC |
691 | extern bfd_boolean |
692 | ldlang_override_segment_assignment | |
693 | (struct bfd_link_info *, bfd *, asection *, asection *, bfd_boolean); | |
694 | ||
01554a74 AM |
695 | extern void |
696 | lang_ld_feature (char *); | |
697 | ||
3604cb1f TG |
698 | extern void |
699 | lang_print_memory_usage (void); | |
700 | ||
4153b6db NC |
701 | extern void |
702 | lang_add_gc_name (const char *); | |
703 | ||
252b5132 | 704 | #endif |