ldlang.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. /* ldlang.h - linker command language support
  2. Copyright (C) 1991-2022 Free Software Foundation, Inc.
  3. This file is part of the GNU Binutils.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #ifndef LDLANG_H
  17. #define LDLANG_H
  18. #define DEFAULT_MEMORY_REGION "*default*"
  19. #define SECTION_NAME_MAP_LENGTH (16)
  20. typedef enum
  21. {
  22. lang_input_file_is_l_enum,
  23. lang_input_file_is_symbols_only_enum,
  24. lang_input_file_is_marker_enum,
  25. lang_input_file_is_fake_enum,
  26. lang_input_file_is_search_file_enum,
  27. lang_input_file_is_file_enum
  28. } lang_input_file_enum_type;
  29. struct _fill_type
  30. {
  31. size_t size;
  32. unsigned char data[1];
  33. };
  34. typedef struct statement_list
  35. {
  36. union lang_statement_union * head;
  37. union lang_statement_union ** tail;
  38. } lang_statement_list_type;
  39. typedef struct memory_region_name_struct
  40. {
  41. const char * name;
  42. struct memory_region_name_struct * next;
  43. } lang_memory_region_name;
  44. typedef struct memory_region_struct
  45. {
  46. lang_memory_region_name name_list;
  47. struct memory_region_struct *next;
  48. union etree_union *origin_exp;
  49. bfd_vma origin;
  50. bfd_size_type length;
  51. union etree_union *length_exp;
  52. bfd_vma current;
  53. union lang_statement_union *last_os;
  54. flagword flags;
  55. flagword not_flags;
  56. bool had_full_message;
  57. } lang_memory_region_type;
  58. enum statement_enum
  59. {
  60. lang_address_statement_enum,
  61. lang_assignment_statement_enum,
  62. lang_data_statement_enum,
  63. lang_fill_statement_enum,
  64. lang_group_statement_enum,
  65. lang_input_section_enum,
  66. lang_input_statement_enum,
  67. lang_insert_statement_enum,
  68. lang_output_section_statement_enum,
  69. lang_output_statement_enum,
  70. lang_padding_statement_enum,
  71. lang_reloc_statement_enum,
  72. lang_target_statement_enum,
  73. lang_wild_statement_enum,
  74. lang_constructors_statement_enum,
  75. lang_object_symbols_statement_enum
  76. };
  77. typedef struct lang_statement_header_struct
  78. {
  79. /* Next pointer for statement_list statement list. */
  80. union lang_statement_union *next;
  81. enum statement_enum type;
  82. } lang_statement_header_type;
  83. typedef struct
  84. {
  85. lang_statement_header_type header;
  86. union etree_union *exp;
  87. } lang_assignment_statement_type;
  88. typedef struct lang_target_statement_struct
  89. {
  90. lang_statement_header_type header;
  91. const char *target;
  92. } lang_target_statement_type;
  93. typedef struct lang_output_statement_struct
  94. {
  95. lang_statement_header_type header;
  96. const char *name;
  97. } lang_output_statement_type;
  98. /* Section types specified in a linker script. */
  99. enum section_type
  100. {
  101. normal_section,
  102. first_overlay_section,
  103. overlay_section,
  104. noload_section,
  105. noalloc_section,
  106. type_section,
  107. readonly_section,
  108. typed_readonly_section
  109. };
  110. /* This structure holds a list of program headers describing
  111. segments in which this section should be placed. */
  112. typedef struct lang_output_section_phdr_list
  113. {
  114. struct lang_output_section_phdr_list *next;
  115. const char *name;
  116. bool used;
  117. } lang_output_section_phdr_list;
  118. typedef struct lang_output_section_statement_struct
  119. {
  120. lang_statement_header_type header;
  121. lang_statement_list_type children;
  122. struct lang_output_section_statement_struct *next;
  123. struct lang_output_section_statement_struct *prev;
  124. const char *name;
  125. asection *bfd_section;
  126. lang_memory_region_type *region;
  127. lang_memory_region_type *lma_region;
  128. fill_type *fill;
  129. union etree_union *addr_tree;
  130. union etree_union *load_base;
  131. union etree_union *section_alignment;
  132. union etree_union *subsection_alignment;
  133. /* If non-null, an expression to evaluate after setting the section's
  134. size. The expression is evaluated inside REGION (above) with '.'
  135. set to the end of the section. Used in the last overlay section
  136. to move '.' past all the overlaid sections. */
  137. union etree_union *update_dot_tree;
  138. lang_output_section_phdr_list *phdrs;
  139. /* Used by ELF SHF_LINK_ORDER sorting. */
  140. void *data;
  141. unsigned int block_value;
  142. int constraint;
  143. flagword flags;
  144. enum section_type sectype;
  145. etree_type *sectype_value;
  146. unsigned int processed_vma : 1;
  147. unsigned int processed_lma : 1;
  148. unsigned int all_input_readonly : 1;
  149. /* If this section should be ignored. */
  150. unsigned int ignored : 1;
  151. /* If this section should update "dot". Prevents section being ignored. */
  152. unsigned int update_dot : 1;
  153. /* If this section is after assignment to _end. */
  154. unsigned int after_end : 1;
  155. /* If this section uses the alignment of its input sections. */
  156. unsigned int align_lma_with_input : 1;
  157. /* If script has duplicate output section statements of the same name
  158. create duplicate output sections. */
  159. unsigned int dup_output : 1;
  160. } lang_output_section_statement_type;
  161. typedef struct
  162. {
  163. lang_statement_header_type header;
  164. fill_type *fill;
  165. int size;
  166. asection *output_section;
  167. } lang_fill_statement_type;
  168. typedef struct
  169. {
  170. lang_statement_header_type header;
  171. unsigned int type;
  172. union etree_union *exp;
  173. bfd_vma value;
  174. asection *output_section;
  175. bfd_vma output_offset;
  176. } lang_data_statement_type;
  177. /* Generate a reloc in the output file. */
  178. typedef struct
  179. {
  180. lang_statement_header_type header;
  181. /* Reloc to generate. */
  182. bfd_reloc_code_real_type reloc;
  183. /* Reloc howto structure. */
  184. reloc_howto_type *howto;
  185. /* Section to generate reloc against.
  186. Exactly one of section and name must be NULL. */
  187. asection *section;
  188. /* Name of symbol to generate reloc against.
  189. Exactly one of section and name must be NULL. */
  190. const char *name;
  191. /* Expression for addend. */
  192. union etree_union *addend_exp;
  193. /* Resolved addend. */
  194. bfd_vma addend_value;
  195. /* Output section where reloc should be performed. */
  196. asection *output_section;
  197. /* Offset within output section. */
  198. bfd_vma output_offset;
  199. } lang_reloc_statement_type;
  200. struct lang_input_statement_flags
  201. {
  202. /* 1 means this file was specified in a -l option. */
  203. unsigned int maybe_archive : 1;
  204. /* 1 means this file was specified in a -l:namespec option. */
  205. unsigned int full_name_provided : 1;
  206. /* 1 means search a set of directories for this file. */
  207. unsigned int search_dirs : 1;
  208. /* 1 means this was found when processing a script in the sysroot. */
  209. unsigned int sysrooted : 1;
  210. /* 1 means this is base file of incremental load.
  211. Do not load this file's text or data.
  212. Also default text_start to after this file's bss. */
  213. unsigned int just_syms : 1;
  214. /* Whether to search for this entry as a dynamic archive. */
  215. unsigned int dynamic : 1;
  216. /* Set if a DT_NEEDED tag should be added not just for the dynamic library
  217. explicitly given by this entry but also for any dynamic libraries in
  218. this entry's needed list. */
  219. unsigned int add_DT_NEEDED_for_dynamic : 1;
  220. /* Set if this entry should cause a DT_NEEDED tag only when some
  221. regular file references its symbols (ie. --as-needed is in effect). */
  222. unsigned int add_DT_NEEDED_for_regular : 1;
  223. /* Whether to include the entire contents of an archive. */
  224. unsigned int whole_archive : 1;
  225. /* Set when bfd opening is successful. */
  226. unsigned int loaded : 1;
  227. unsigned int real : 1;
  228. /* Set if the file does not exist. */
  229. unsigned int missing_file : 1;
  230. /* Set if reloading an archive or --as-needed lib. */
  231. unsigned int reload : 1;
  232. #if BFD_SUPPORTS_PLUGINS
  233. /* Set if the file was claimed by a plugin. */
  234. unsigned int claimed : 1;
  235. /* Set if the file was claimed from an archive. */
  236. unsigned int claim_archive : 1;
  237. /* Set if added by the lto plugin add_input_file callback. */
  238. unsigned int lto_output : 1;
  239. #endif /* BFD_SUPPORTS_PLUGINS */
  240. /* Head of list of pushed flags. */
  241. struct lang_input_statement_flags *pushed;
  242. };
  243. typedef struct lang_input_statement_struct
  244. {
  245. lang_statement_header_type header;
  246. /* Name of this file. */
  247. const char *filename;
  248. /* Name to use for the symbol giving address of text start.
  249. Usually the same as filename, but for a file spec'd with
  250. -l this is the -l switch itself rather than the filename. */
  251. const char *local_sym_name;
  252. /* Extra search path. Used to find a file relative to the
  253. directory of the current linker script. */
  254. const char *extra_search_path;
  255. bfd *the_bfd;
  256. ctf_archive_t *the_ctf;
  257. struct flag_info *section_flag_list;
  258. /* Next pointer for file_chain statement list. */
  259. struct lang_input_statement_struct *next;
  260. /* Next pointer for input_file_chain statement list. */
  261. struct lang_input_statement_struct *next_real_file;
  262. const char *target;
  263. struct lang_input_statement_flags flags;
  264. } lang_input_statement_type;
  265. typedef struct
  266. {
  267. lang_statement_header_type header;
  268. asection *section;
  269. void *pattern;
  270. } lang_input_section_type;
  271. struct map_symbol_def {
  272. struct bfd_link_hash_entry *entry;
  273. struct map_symbol_def *next;
  274. };
  275. /* For input sections, when writing a map file: head / tail of a linked
  276. list of hash table entries for symbols defined in this section. */
  277. typedef struct input_section_userdata_struct
  278. {
  279. struct map_symbol_def *map_symbol_def_head;
  280. struct map_symbol_def **map_symbol_def_tail;
  281. unsigned long map_symbol_def_count;
  282. } input_section_userdata_type;
  283. static inline bool
  284. bfd_input_just_syms (const bfd *abfd)
  285. {
  286. lang_input_statement_type *is = bfd_usrdata (abfd);
  287. return is != NULL && is->flags.just_syms;
  288. }
  289. typedef struct lang_wild_statement_struct lang_wild_statement_type;
  290. typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  291. asection *, lang_input_statement_type *, void *);
  292. typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
  293. lang_input_statement_type *,
  294. callback_t callback,
  295. void *data);
  296. typedef bool (*lang_match_sec_type_func) (bfd *, const asection *,
  297. bfd *, const asection *);
  298. /* Binary search tree structure to efficiently sort sections by
  299. name. */
  300. typedef struct lang_section_bst
  301. {
  302. asection *section;
  303. void *pattern;
  304. struct lang_section_bst *left;
  305. struct lang_section_bst *right;
  306. } lang_section_bst_type;
  307. struct lang_wild_statement_struct
  308. {
  309. lang_statement_header_type header;
  310. const char *filename;
  311. bool filenames_sorted;
  312. struct wildcard_list *section_list;
  313. bool keep_sections;
  314. lang_statement_list_type children;
  315. struct name_list *exclude_name_list;
  316. walk_wild_section_handler_t walk_wild_section_handler;
  317. struct wildcard_list *handler_data[4];
  318. lang_section_bst_type *tree;
  319. struct flag_info *section_flag_list;
  320. };
  321. typedef struct lang_address_statement_struct
  322. {
  323. lang_statement_header_type header;
  324. const char *section_name;
  325. union etree_union *address;
  326. const segment_type *segment;
  327. } lang_address_statement_type;
  328. typedef struct
  329. {
  330. lang_statement_header_type header;
  331. bfd_vma output_offset;
  332. bfd_size_type size;
  333. asection *output_section;
  334. fill_type *fill;
  335. } lang_padding_statement_type;
  336. /* A group statement collects a set of libraries together. The
  337. libraries are searched multiple times, until no new undefined
  338. symbols are found. The effect is to search a group of libraries as
  339. though they were a single library. */
  340. typedef struct
  341. {
  342. lang_statement_header_type header;
  343. lang_statement_list_type children;
  344. } lang_group_statement_type;
  345. typedef struct
  346. {
  347. lang_statement_header_type header;
  348. const char *where;
  349. bool is_before;
  350. } lang_insert_statement_type;
  351. typedef union lang_statement_union
  352. {
  353. lang_statement_header_type header;
  354. lang_address_statement_type address_statement;
  355. lang_assignment_statement_type assignment_statement;
  356. lang_data_statement_type data_statement;
  357. lang_fill_statement_type fill_statement;
  358. lang_group_statement_type group_statement;
  359. lang_input_section_type input_section;
  360. lang_input_statement_type input_statement;
  361. lang_insert_statement_type insert_statement;
  362. lang_output_section_statement_type output_section_statement;
  363. lang_output_statement_type output_statement;
  364. lang_padding_statement_type padding_statement;
  365. lang_reloc_statement_type reloc_statement;
  366. lang_target_statement_type target_statement;
  367. lang_wild_statement_type wild_statement;
  368. } lang_statement_union_type;
  369. /* This structure holds information about a program header, from the
  370. PHDRS command in the linker script. */
  371. struct lang_phdr
  372. {
  373. struct lang_phdr *next;
  374. const char *name;
  375. unsigned long type;
  376. bool filehdr;
  377. bool phdrs;
  378. etree_type *at;
  379. etree_type *flags;
  380. };
  381. /* This structure is used to hold a list of sections which may not
  382. cross reference each other. */
  383. typedef struct lang_nocrossref
  384. {
  385. struct lang_nocrossref *next;
  386. const char *name;
  387. } lang_nocrossref_type;
  388. /* The list of nocrossref lists. */
  389. struct lang_nocrossrefs
  390. {
  391. struct lang_nocrossrefs *next;
  392. lang_nocrossref_type *list;
  393. bool onlyfirst;
  394. };
  395. /* This structure is used to hold a list of input section names which
  396. will not match an output section in the linker script. */
  397. struct unique_sections
  398. {
  399. struct unique_sections *next;
  400. const char *name;
  401. };
  402. /* Used by place_orphan to keep track of orphan sections and statements. */
  403. struct orphan_save
  404. {
  405. const char *name;
  406. flagword flags;
  407. lang_output_section_statement_type *os;
  408. asection **section;
  409. lang_statement_union_type **stmt;
  410. lang_output_section_statement_type **os_tail;
  411. };
  412. struct asneeded_minfo
  413. {
  414. struct asneeded_minfo *next;
  415. const char *soname;
  416. bfd *ref;
  417. const char *name;
  418. };
  419. extern struct lang_phdr *lang_phdr_list;
  420. extern struct lang_nocrossrefs *nocrossref_list;
  421. extern const char *output_target;
  422. extern lang_output_section_statement_type *abs_output_section;
  423. extern lang_statement_list_type lang_os_list;
  424. extern struct lang_input_statement_flags input_flags;
  425. extern bool lang_has_input_file;
  426. extern lang_statement_list_type statement_list;
  427. extern lang_statement_list_type *stat_ptr;
  428. extern bool delete_output_file_on_failure;
  429. extern struct bfd_sym_chain entry_symbol;
  430. extern const char *entry_section;
  431. extern bool entry_from_cmdline;
  432. extern lang_statement_list_type file_chain;
  433. extern lang_statement_list_type input_file_chain;
  434. extern struct bfd_elf_dynamic_list **current_dynamic_list_p;
  435. extern int lang_statement_iteration;
  436. extern struct asneeded_minfo **asneeded_list_tail;
  437. extern void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *);
  438. extern void lang_init
  439. (void);
  440. extern void lang_finish
  441. (void);
  442. extern lang_memory_region_type * lang_memory_region_lookup
  443. (const char * const, bool);
  444. extern void lang_memory_region_alias
  445. (const char *, const char *);
  446. extern void lang_map
  447. (void);
  448. extern void lang_set_flags
  449. (lang_memory_region_type *, const char *, int);
  450. extern void lang_add_output
  451. (const char *, int from_script);
  452. extern lang_output_section_statement_type *lang_enter_output_section_statement
  453. (const char *, etree_type *, enum section_type, etree_type *, etree_type *,
  454. etree_type *, etree_type *, int, int);
  455. extern void lang_final
  456. (void);
  457. extern void lang_relax_sections
  458. (bool);
  459. extern void lang_process
  460. (void);
  461. extern void lang_section_start
  462. (const char *, union etree_union *, const segment_type *);
  463. extern void lang_add_entry
  464. (const char *, bool);
  465. extern void lang_default_entry
  466. (const char *);
  467. extern void lang_add_target
  468. (const char *);
  469. extern void lang_add_wild
  470. (struct wildcard_spec *, struct wildcard_list *, bool);
  471. extern void lang_add_map
  472. (const char *);
  473. extern void lang_add_fill
  474. (fill_type *);
  475. extern lang_assignment_statement_type *lang_add_assignment
  476. (union etree_union *);
  477. extern void lang_add_attribute
  478. (enum statement_enum);
  479. extern void lang_startup
  480. (const char *);
  481. extern void lang_float
  482. (bool);
  483. extern void lang_leave_output_section_statement
  484. (fill_type *, const char *, lang_output_section_phdr_list *,
  485. const char *);
  486. extern void lang_for_each_input_file
  487. (void (*dothis) (lang_input_statement_type *));
  488. extern void lang_for_each_file
  489. (void (*dothis) (lang_input_statement_type *));
  490. extern void lang_reset_memory_regions
  491. (void);
  492. extern void lang_do_assignments
  493. (lang_phase_type);
  494. extern asection *section_for_dot
  495. (void);
  496. #define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
  497. lang_input_statement_type *statement; \
  498. for (statement = (lang_input_statement_type *) file_chain.head; \
  499. statement != NULL; \
  500. statement = statement->next)
  501. #define lang_output_section_find(NAME) \
  502. lang_output_section_statement_lookup (NAME, 0, 0)
  503. extern void lang_process
  504. (void);
  505. extern void ldlang_add_file
  506. (lang_input_statement_type *);
  507. extern lang_output_section_statement_type *lang_output_section_find_by_flags
  508. (const asection *, flagword, lang_output_section_statement_type **,
  509. lang_match_sec_type_func);
  510. extern lang_output_section_statement_type *lang_insert_orphan
  511. (asection *, const char *, int, lang_output_section_statement_type *,
  512. struct orphan_save *, etree_type *, lang_statement_list_type *);
  513. extern lang_input_statement_type *lang_add_input_file
  514. (const char *, lang_input_file_enum_type, const char *);
  515. extern void lang_add_keepsyms_file
  516. (const char *);
  517. extern lang_output_section_statement_type *lang_output_section_get
  518. (const asection *);
  519. extern lang_output_section_statement_type *lang_output_section_statement_lookup
  520. (const char *, int, int);
  521. extern lang_output_section_statement_type *next_matching_output_section_statement
  522. (lang_output_section_statement_type *, int);
  523. extern void ldlang_add_undef
  524. (const char *const, bool);
  525. extern void ldlang_add_require_defined
  526. (const char *const);
  527. extern void lang_add_output_format
  528. (const char *, const char *, const char *, int);
  529. extern void lang_list_init
  530. (lang_statement_list_type *);
  531. extern void push_stat_ptr
  532. (lang_statement_list_type *);
  533. extern void pop_stat_ptr
  534. (void);
  535. extern void lang_add_data
  536. (int type, union etree_union *);
  537. extern void lang_add_reloc
  538. (bfd_reloc_code_real_type, reloc_howto_type *, asection *, const char *,
  539. union etree_union *);
  540. extern void lang_for_each_statement
  541. (void (*) (lang_statement_union_type *));
  542. extern void lang_for_each_statement_worker
  543. (void (*) (lang_statement_union_type *), lang_statement_union_type *);
  544. extern void *stat_alloc
  545. (size_t);
  546. extern void strip_excluded_output_sections
  547. (void);
  548. extern void lang_clear_os_map
  549. (void);
  550. extern void dprint_statement
  551. (lang_statement_union_type *, int);
  552. extern void lang_size_sections
  553. (bool *, bool);
  554. extern void one_lang_size_sections_pass
  555. (bool *, bool);
  556. extern void lang_add_insert
  557. (const char *, int);
  558. extern void lang_enter_group
  559. (void);
  560. extern void lang_leave_group
  561. (void);
  562. extern void lang_add_section
  563. (lang_statement_list_type *, asection *, struct wildcard_list *,
  564. struct flag_info *, lang_output_section_statement_type *);
  565. extern void lang_new_phdr
  566. (const char *, etree_type *, bool, bool, etree_type *,
  567. etree_type *);
  568. extern void lang_add_nocrossref
  569. (lang_nocrossref_type *);
  570. extern void lang_add_nocrossref_to
  571. (lang_nocrossref_type *);
  572. extern void lang_enter_overlay
  573. (etree_type *, etree_type *);
  574. extern void lang_enter_overlay_section
  575. (const char *);
  576. extern void lang_leave_overlay_section
  577. (fill_type *, lang_output_section_phdr_list *);
  578. extern void lang_leave_overlay
  579. (etree_type *, int, fill_type *, const char *,
  580. lang_output_section_phdr_list *, const char *);
  581. extern struct bfd_elf_version_expr *lang_new_vers_pattern
  582. (struct bfd_elf_version_expr *, const char *, const char *, bool);
  583. extern struct bfd_elf_version_tree *lang_new_vers_node
  584. (struct bfd_elf_version_expr *, struct bfd_elf_version_expr *);
  585. extern struct bfd_elf_version_deps *lang_add_vers_depend
  586. (struct bfd_elf_version_deps *, const char *);
  587. extern void lang_register_vers_node
  588. (const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *);
  589. extern void lang_append_dynamic_list (struct bfd_elf_dynamic_list **,
  590. struct bfd_elf_version_expr *);
  591. extern void lang_append_dynamic_list_cpp_typeinfo (void);
  592. extern void lang_append_dynamic_list_cpp_new (void);
  593. extern void lang_add_unique
  594. (const char *);
  595. extern const char *lang_get_output_target
  596. (void);
  597. extern void add_excluded_libs (const char *);
  598. extern bool load_symbols
  599. (lang_input_statement_type *, lang_statement_list_type *);
  600. struct elf_sym_strtab;
  601. struct elf_strtab_hash;
  602. extern void ldlang_ctf_acquire_strings
  603. (struct elf_strtab_hash *);
  604. extern void ldlang_ctf_new_dynsym
  605. (int symidx, struct elf_internal_sym *);
  606. extern void ldlang_write_ctf_late
  607. (void);
  608. extern bool
  609. ldlang_override_segment_assignment
  610. (struct bfd_link_info *, bfd *, asection *, asection *, bool);
  611. extern void
  612. lang_ld_feature (char *);
  613. extern void
  614. lang_print_memory_usage (void);
  615. extern void
  616. lang_add_gc_name (const char *);
  617. extern bool
  618. print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr);
  619. #endif