133965Sjdp/* ldlang.h - linker command language support
278828Sobrien   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3218822Sdim   2001, 2002, 2003, 2004, 2005, 2006
460484Sobrien   Free Software Foundation, Inc.
577298Sobrien
633965Sjdp   This file is part of GLD, the Gnu Linker.
777298Sobrien
833965Sjdp   GLD is free software; you can redistribute it and/or modify
933965Sjdp   it under the terms of the GNU General Public License as published by
1091041Sobrien   the Free Software Foundation; either version 2, or (at your option)
1133965Sjdp   any later version.
1277298Sobrien
1333965Sjdp   GLD is distributed in the hope that it will be useful,
1433965Sjdp   but WITHOUT ANY WARRANTY; without even the implied warranty of
1533965Sjdp   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1633965Sjdp   GNU General Public License for more details.
1777298Sobrien
1833965Sjdp   You should have received a copy of the GNU General Public License
1933965Sjdp   along with GLD; see the file COPYING.  If not, write to the Free
20218822Sdim   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
21218822Sdim   02110-1301, USA.  */
2233965Sjdp
2333965Sjdp#ifndef LDLANG_H
2433965Sjdp#define LDLANG_H
2533965Sjdp
26130561Sobrien#define DEFAULT_MEMORY_REGION   "*default*"
27130561Sobrien
28130561Sobrientypedef enum
29130561Sobrien{
3033965Sjdp  lang_input_file_is_l_enum,
3133965Sjdp  lang_input_file_is_symbols_only_enum,
3233965Sjdp  lang_input_file_is_marker_enum,
3333965Sjdp  lang_input_file_is_fake_enum,
3433965Sjdp  lang_input_file_is_search_file_enum,
3533965Sjdp  lang_input_file_is_file_enum
3633965Sjdp} lang_input_file_enum_type;
3733965Sjdp
38130561Sobrienstruct _fill_type
39130561Sobrien{
40104834Sobrien  size_t size;
41104834Sobrien  unsigned char data[1];
42104834Sobrien};
4377298Sobrien
44130561Sobrientypedef struct statement_list
45130561Sobrien{
4633965Sjdp  union lang_statement_union *head;
4733965Sjdp  union lang_statement_union **tail;
4833965Sjdp} lang_statement_list_type;
4933965Sjdp
50130561Sobrientypedef struct memory_region_struct
51130561Sobrien{
5233965Sjdp  char *name;
5333965Sjdp  struct memory_region_struct *next;
5433965Sjdp  bfd_vma origin;
5533965Sjdp  bfd_size_type length;
5633965Sjdp  bfd_vma current;
57218822Sdim  union lang_statement_union *last_os;
5838889Sjdp  flagword flags;
5938889Sjdp  flagword not_flags;
60130561Sobrien  bfd_boolean had_full_message;
6177298Sobrien} lang_memory_region_type;
6233965Sjdp
63130561Sobrientypedef struct lang_statement_header_struct
64130561Sobrien{
6577298Sobrien  union lang_statement_union *next;
66130561Sobrien  enum statement_enum
67130561Sobrien  {
6877298Sobrien    lang_output_section_statement_enum,
6977298Sobrien    lang_assignment_statement_enum,
7077298Sobrien    lang_input_statement_enum,
7177298Sobrien    lang_address_statement_enum,
7277298Sobrien    lang_wild_statement_enum,
7377298Sobrien    lang_input_section_enum,
7477298Sobrien    lang_object_symbols_statement_enum,
7577298Sobrien    lang_fill_statement_enum,
7677298Sobrien    lang_data_statement_enum,
7777298Sobrien    lang_reloc_statement_enum,
7877298Sobrien    lang_target_statement_enum,
7977298Sobrien    lang_output_statement_enum,
8077298Sobrien    lang_padding_statement_enum,
8177298Sobrien    lang_group_statement_enum,
8233965Sjdp
8377298Sobrien    lang_afile_asection_pair_statement_enum,
8477298Sobrien    lang_constructors_statement_enum
8577298Sobrien  } type;
8633965Sjdp} lang_statement_header_type;
8733965Sjdp
88130561Sobrientypedef struct
89130561Sobrien{
9033965Sjdp  lang_statement_header_type header;
9133965Sjdp  union etree_union *exp;
9233965Sjdp} lang_assignment_statement_type;
9333965Sjdp
94130561Sobrientypedef struct lang_target_statement_struct
95130561Sobrien{
9633965Sjdp  lang_statement_header_type header;
9733965Sjdp  const char *target;
9833965Sjdp} lang_target_statement_type;
9933965Sjdp
100130561Sobrientypedef struct lang_output_statement_struct
101130561Sobrien{
10233965Sjdp  lang_statement_header_type header;
10333965Sjdp  const char *name;
10433965Sjdp} lang_output_statement_type;
10533965Sjdp
10633965Sjdp/* Section types specified in a linker script.  */
10733965Sjdp
108130561Sobrienenum section_type
109130561Sobrien{
11033965Sjdp  normal_section,
111218822Sdim  overlay_section,
11233965Sjdp  noload_section,
113218822Sdim  noalloc_section
11433965Sjdp};
11533965Sjdp
116130561Sobrien/* This structure holds a list of program headers describing
117130561Sobrien   segments in which this section should be placed.  */
11833965Sjdp
119130561Sobrientypedef struct lang_output_section_phdr_list
120130561Sobrien{
12133965Sjdp  struct lang_output_section_phdr_list *next;
12233965Sjdp  const char *name;
123130561Sobrien  bfd_boolean used;
124130561Sobrien} lang_output_section_phdr_list;
12533965Sjdp
126130561Sobrientypedef struct lang_output_section_statement_struct
127130561Sobrien{
12833965Sjdp  lang_statement_header_type header;
12933965Sjdp  lang_statement_list_type children;
130218822Sdim  struct lang_output_section_statement_struct *next;
131218822Sdim  struct lang_output_section_statement_struct *prev;
13233965Sjdp  const char *name;
13333965Sjdp  asection *bfd_section;
134130561Sobrien  lang_memory_region_type *region;
135130561Sobrien  lang_memory_region_type *lma_region;
136104834Sobrien  fill_type *fill;
137218822Sdim  union etree_union *addr_tree;
13833965Sjdp  union etree_union *load_base;
13933965Sjdp
140104834Sobrien  /* If non-null, an expression to evaluate after setting the section's
141104834Sobrien     size.  The expression is evaluated inside REGION (above) with '.'
142104834Sobrien     set to the end of the section.  Used in the last overlay section
143104834Sobrien     to move '.' past all the overlaid sections.  */
144104834Sobrien  union etree_union *update_dot_tree;
145104834Sobrien
146130561Sobrien  lang_output_section_phdr_list *phdrs;
147218822Sdim
148218822Sdim  unsigned int block_value;
149218822Sdim  int subsection_alignment;	/* Alignment of components.  */
150218822Sdim  int section_alignment;	/* Alignment of start of section.  */
151218822Sdim  int constraint;
152218822Sdim  flagword flags;
153218822Sdim  enum section_type sectype;
154218822Sdim  unsigned int processed_vma : 1;
155218822Sdim  unsigned int processed_lma : 1;
156218822Sdim  unsigned int all_input_readonly : 1;
157218822Sdim  /* If this section should be ignored.  */
158218822Sdim  unsigned int ignored : 1;
159218822Sdim  /* If there is a symbol relative to this section.  */
160218822Sdim  unsigned int section_relative_symbol : 1;
16133965Sjdp} lang_output_section_statement_type;
16233965Sjdp
163130561Sobrientypedef struct
164130561Sobrien{
16533965Sjdp  lang_statement_header_type header;
16633965Sjdp} lang_common_statement_type;
16733965Sjdp
168130561Sobrientypedef struct
169130561Sobrien{
17033965Sjdp  lang_statement_header_type header;
17133965Sjdp} lang_object_symbols_statement_type;
17233965Sjdp
173130561Sobrientypedef struct
174130561Sobrien{
17533965Sjdp  lang_statement_header_type header;
176104834Sobrien  fill_type *fill;
17733965Sjdp  int size;
17833965Sjdp  asection *output_section;
17933965Sjdp} lang_fill_statement_type;
18033965Sjdp
181130561Sobrientypedef struct
182130561Sobrien{
18333965Sjdp  lang_statement_header_type header;
18433965Sjdp  unsigned int type;
18577298Sobrien  union etree_union *exp;
18633965Sjdp  bfd_vma value;
18733965Sjdp  asection *output_section;
188218822Sdim  bfd_vma output_offset;
18933965Sjdp} lang_data_statement_type;
19033965Sjdp
19133965Sjdp/* Generate a reloc in the output file.  */
19233965Sjdp
193130561Sobrientypedef struct
194130561Sobrien{
19533965Sjdp  lang_statement_header_type header;
19633965Sjdp
19733965Sjdp  /* Reloc to generate.  */
19833965Sjdp  bfd_reloc_code_real_type reloc;
19933965Sjdp
20033965Sjdp  /* Reloc howto structure.  */
20133965Sjdp  reloc_howto_type *howto;
20233965Sjdp
203130561Sobrien  /* Section to generate reloc against.
204130561Sobrien     Exactly one of section and name must be NULL.  */
20533965Sjdp  asection *section;
20633965Sjdp
207130561Sobrien  /* Name of symbol to generate reloc against.
208130561Sobrien     Exactly one of section and name must be NULL.  */
20933965Sjdp  const char *name;
21033965Sjdp
21133965Sjdp  /* Expression for addend.  */
21233965Sjdp  union etree_union *addend_exp;
21333965Sjdp
21433965Sjdp  /* Resolved addend.  */
21533965Sjdp  bfd_vma addend_value;
21633965Sjdp
21733965Sjdp  /* Output section where reloc should be performed.  */
21833965Sjdp  asection *output_section;
21933965Sjdp
220218822Sdim  /* Offset within output section.  */
221218822Sdim  bfd_vma output_offset;
22233965Sjdp} lang_reloc_statement_type;
22333965Sjdp
224130561Sobrientypedef struct lang_input_statement_struct
225130561Sobrien{
22633965Sjdp  lang_statement_header_type header;
22733965Sjdp  /* Name of this file.  */
22833965Sjdp  const char *filename;
229130561Sobrien  /* Name to use for the symbol giving address of text start.
230130561Sobrien     Usually the same as filename, but for a file spec'd with
231130561Sobrien     -l this is the -l switch itself rather than the filename.  */
23233965Sjdp  const char *local_sym_name;
23377298Sobrien
23433965Sjdp  bfd *the_bfd;
23577298Sobrien
23633965Sjdp  file_ptr passive_position;
23777298Sobrien
23833965Sjdp  /* Symbol table of the file.  */
23933965Sjdp  asymbol **asymbols;
24033965Sjdp  unsigned int symbol_count;
24177298Sobrien
24233965Sjdp  /* Point to the next file - whatever it is, wanders up and down
24333965Sjdp     archives */
244130561Sobrien  union lang_statement_union *next;
24577298Sobrien
246130561Sobrien  /* Point to the next file, but skips archive contents.  */
24777298Sobrien  union lang_statement_union *next_real_file;
24877298Sobrien
249218822Sdim  const char *target;
25077298Sobrien
251218822Sdim  unsigned int closed : 1;
252218822Sdim  unsigned int is_archive : 1;
253218822Sdim
25433965Sjdp  /* 1 means search a set of directories for this file.  */
255218822Sdim  unsigned int search_dirs_flag : 1;
25677298Sobrien
257130561Sobrien  /* 1 means this was found in a search directory marked as sysrooted,
258130561Sobrien     if search_dirs_flag is false, otherwise, that it should be
259130561Sobrien     searched in ld_sysroot before any other location, as long as it
260130561Sobrien     starts with a slash.  */
261218822Sdim  unsigned int sysrooted : 1;
262130561Sobrien
26333965Sjdp  /* 1 means this is base file of incremental load.
26433965Sjdp     Do not load this file's text or data.
26577298Sobrien     Also default text_start to after this file's bss.  */
266218822Sdim  unsigned int just_syms_flag : 1;
26777298Sobrien
26833965Sjdp  /* Whether to search for this entry as a dynamic archive.  */
269218822Sdim  unsigned int dynamic : 1;
27033965Sjdp
271218822Sdim  /* Whether DT_NEEDED tags should be added for dynamic libraries in
272218822Sdim     DT_NEEDED tags from this entry.  */
273218822Sdim  unsigned int add_needed : 1;
274218822Sdim
275130561Sobrien  /* Whether this entry should cause a DT_NEEDED tag only when
276130561Sobrien     satisfying references from regular files, or always.  */
277218822Sdim  unsigned int as_needed : 1;
278130561Sobrien
27933965Sjdp  /* Whether to include the entire contents of an archive.  */
280218822Sdim  unsigned int whole_archive : 1;
28133965Sjdp
282218822Sdim  unsigned int loaded : 1;
28377298Sobrien
284218822Sdim  unsigned int real : 1;
28533965Sjdp} lang_input_statement_type;
28633965Sjdp
287130561Sobrientypedef struct
288130561Sobrien{
28933965Sjdp  lang_statement_header_type header;
29033965Sjdp  asection *section;
29133965Sjdp} lang_input_section_type;
29233965Sjdp
293130561Sobrientypedef struct
294130561Sobrien{
29533965Sjdp  lang_statement_header_type header;
29633965Sjdp  asection *section;
29733965Sjdp  union lang_statement_union *file;
29833965Sjdp} lang_afile_asection_pair_statement_type;
29933965Sjdp
300218822Sdimtypedef struct lang_wild_statement_struct lang_wild_statement_type;
301218822Sdim
302218822Sdimtypedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
303218822Sdim			    asection *, lang_input_statement_type *, void *);
304218822Sdim
305218822Sdimtypedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
306218822Sdim					     lang_input_statement_type *,
307218822Sdim					     callback_t callback,
308218822Sdim					     void *data);
309218822Sdim
310218822Sdimtypedef bfd_boolean (*lang_match_sec_type_func) (bfd *, const asection *,
311218822Sdim						 bfd *, const asection *);
312218822Sdim
313218822Sdim/* Binary search tree structure to efficiently sort sections by
314218822Sdim   name.  */
315218822Sdimtypedef struct lang_section_bst
316130561Sobrien{
317218822Sdim  asection *section;
318218822Sdim  struct lang_section_bst *left;
319218822Sdim  struct lang_section_bst *right;
320218822Sdim} lang_section_bst_type;
321218822Sdim
322218822Sdimstruct lang_wild_statement_struct
323218822Sdim{
32433965Sjdp  lang_statement_header_type header;
32533965Sjdp  const char *filename;
326130561Sobrien  bfd_boolean filenames_sorted;
32789857Sobrien  struct wildcard_list *section_list;
328130561Sobrien  bfd_boolean keep_sections;
32933965Sjdp  lang_statement_list_type children;
33033965Sjdp
331218822Sdim  walk_wild_section_handler_t walk_wild_section_handler;
332218822Sdim  struct wildcard_list *handler_data[4];
333218822Sdim  lang_section_bst_type *tree;
334218822Sdim};
335218822Sdim
336130561Sobrientypedef struct lang_address_statement_struct
337130561Sobrien{
33833965Sjdp  lang_statement_header_type header;
33977298Sobrien  const char *section_name;
34077298Sobrien  union etree_union *address;
341218822Sdim  const segment_type *segment;
34233965Sjdp} lang_address_statement_type;
34333965Sjdp
344130561Sobrientypedef struct
345130561Sobrien{
34633965Sjdp  lang_statement_header_type header;
34733965Sjdp  bfd_vma output_offset;
34833965Sjdp  size_t size;
34933965Sjdp  asection *output_section;
350104834Sobrien  fill_type *fill;
35133965Sjdp} lang_padding_statement_type;
35233965Sjdp
35333965Sjdp/* A group statement collects a set of libraries together.  The
35433965Sjdp   libraries are searched multiple times, until no new undefined
35533965Sjdp   symbols are found.  The effect is to search a group of libraries as
35633965Sjdp   though they were a single library.  */
35733965Sjdp
358130561Sobrientypedef struct
359130561Sobrien{
36033965Sjdp  lang_statement_header_type header;
36133965Sjdp  lang_statement_list_type children;
36233965Sjdp} lang_group_statement_type;
36333965Sjdp
364130561Sobrientypedef union lang_statement_union
365130561Sobrien{
36633965Sjdp  lang_statement_header_type header;
36733965Sjdp  lang_wild_statement_type wild_statement;
36833965Sjdp  lang_data_statement_type data_statement;
36933965Sjdp  lang_reloc_statement_type reloc_statement;
37033965Sjdp  lang_address_statement_type address_statement;
37133965Sjdp  lang_output_section_statement_type output_section_statement;
37233965Sjdp  lang_afile_asection_pair_statement_type afile_asection_pair_statement;
37333965Sjdp  lang_assignment_statement_type assignment_statement;
37433965Sjdp  lang_input_statement_type input_statement;
37533965Sjdp  lang_target_statement_type target_statement;
37633965Sjdp  lang_output_statement_type output_statement;
37733965Sjdp  lang_input_section_type input_section;
37833965Sjdp  lang_common_statement_type common_statement;
37933965Sjdp  lang_object_symbols_statement_type object_symbols_statement;
38033965Sjdp  lang_fill_statement_type fill_statement;
38133965Sjdp  lang_padding_statement_type padding_statement;
38233965Sjdp  lang_group_statement_type group_statement;
38333965Sjdp} lang_statement_union_type;
38433965Sjdp
38533965Sjdp/* This structure holds information about a program header, from the
38633965Sjdp   PHDRS command in the linker script.  */
38733965Sjdp
388130561Sobrienstruct lang_phdr
389130561Sobrien{
39033965Sjdp  struct lang_phdr *next;
39133965Sjdp  const char *name;
39233965Sjdp  unsigned long type;
393130561Sobrien  bfd_boolean filehdr;
394130561Sobrien  bfd_boolean phdrs;
39533965Sjdp  etree_type *at;
39633965Sjdp  etree_type *flags;
39733965Sjdp};
39833965Sjdp
399218822Sdimextern struct lang_phdr *lang_phdr_list;
400218822Sdim
40133965Sjdp/* This structure is used to hold a list of sections which may not
40233965Sjdp   cross reference each other.  */
40333965Sjdp
404130561Sobrientypedef struct lang_nocrossref
405130561Sobrien{
40633965Sjdp  struct lang_nocrossref *next;
40733965Sjdp  const char *name;
408130561Sobrien} lang_nocrossref_type;
40933965Sjdp
41033965Sjdp/* The list of nocrossref lists.  */
41133965Sjdp
412130561Sobrienstruct lang_nocrossrefs
413130561Sobrien{
41433965Sjdp  struct lang_nocrossrefs *next;
415130561Sobrien  lang_nocrossref_type *list;
41633965Sjdp};
41733965Sjdp
41833965Sjdpextern struct lang_nocrossrefs *nocrossref_list;
41933965Sjdp
42077298Sobrien/* This structure is used to hold a list of input section names which
42177298Sobrien   will not match an output section in the linker script.  */
42277298Sobrien
423130561Sobrienstruct unique_sections
424130561Sobrien{
42577298Sobrien  struct unique_sections *next;
42677298Sobrien  const char *name;
42777298Sobrien};
42877298Sobrien
429130561Sobrien/* This structure records symbols for which we need to keep track of
430130561Sobrien   definedness for use in the DEFINED () test.  */
431130561Sobrien
432130561Sobrienstruct lang_definedness_hash_entry
433130561Sobrien{
434130561Sobrien  struct bfd_hash_entry root;
435130561Sobrien  int iteration;
436130561Sobrien};
437130561Sobrien
438218822Sdim/* Used by place_orphan to keep track of orphan sections and statements.  */
43977298Sobrien
440218822Sdimstruct orphan_save {
441218822Sdim  const char *name;
442218822Sdim  flagword flags;
443218822Sdim  lang_output_section_statement_type *os;
444218822Sdim  asection **section;
445218822Sdim  lang_statement_union_type **stmt;
446218822Sdim  lang_output_section_statement_type **os_tail;
447218822Sdim};
448218822Sdim
44933965Sjdpextern lang_output_section_statement_type *abs_output_section;
45068765Sobrienextern lang_statement_list_type lang_output_section_statement;
451130561Sobrienextern bfd_boolean lang_has_input_file;
45233965Sjdpextern etree_type *base;
45333965Sjdpextern lang_statement_list_type *stat_ptr;
454130561Sobrienextern bfd_boolean delete_output_file_on_failure;
45533965Sjdp
456104834Sobrienextern struct bfd_sym_chain entry_symbol;
45791041Sobrienextern const char *entry_section;
458130561Sobrienextern bfd_boolean entry_from_cmdline;
45977298Sobrienextern lang_statement_list_type file_chain;
460218822Sdimextern lang_statement_list_type input_file_chain;
46133965Sjdp
462130561Sobrienextern int lang_statement_iteration;
463130561Sobrien
464130561Sobrienextern void lang_init
465130561Sobrien  (void);
466218822Sdimextern void lang_finish
467218822Sdim  (void);
468130561Sobrienextern lang_memory_region_type *lang_memory_region_lookup
469130561Sobrien  (const char *const, bfd_boolean);
470130561Sobrienextern lang_memory_region_type *lang_memory_region_default
471130561Sobrien  (asection *);
472130561Sobrienextern void lang_map
473130561Sobrien  (void);
474130561Sobrienextern void lang_set_flags
475130561Sobrien  (lang_memory_region_type *, const char *, int);
476130561Sobrienextern void lang_add_output
477130561Sobrien  (const char *, int from_script);
47868765Sobrienextern lang_output_section_statement_type *lang_enter_output_section_statement
479130561Sobrien  (const char *output_section_statement_name,
480130561Sobrien   etree_type *address_exp,
481130561Sobrien   enum section_type sectype,
482130561Sobrien   etree_type *align,
483130561Sobrien   etree_type *subalign,
484218822Sdim   etree_type *, int);
485130561Sobrienextern void lang_final
486130561Sobrien  (void);
487130561Sobrienextern void lang_process
488130561Sobrien  (void);
489130561Sobrienextern void lang_section_start
490218822Sdim  (const char *, union etree_union *, const segment_type *);
491130561Sobrienextern void lang_add_entry
492130561Sobrien  (const char *, bfd_boolean);
493218822Sdimextern void lang_default_entry
494218822Sdim  (const char *);
495130561Sobrienextern void lang_add_target
496130561Sobrien  (const char *);
49760484Sobrienextern void lang_add_wild
498130561Sobrien  (struct wildcard_spec *, struct wildcard_list *, bfd_boolean);
499130561Sobrienextern void lang_add_map
500130561Sobrien  (const char *);
501130561Sobrienextern void lang_add_fill
502130561Sobrien  (fill_type *);
503130561Sobrienextern lang_assignment_statement_type *lang_add_assignment
504130561Sobrien  (union etree_union *);
505130561Sobrienextern void lang_add_attribute
506130561Sobrien  (enum statement_enum);
507130561Sobrienextern void lang_startup
508130561Sobrien  (const char *);
509130561Sobrienextern void lang_float
510130561Sobrien  (bfd_boolean);
51133965Sjdpextern void lang_leave_output_section_statement
512130561Sobrien  (fill_type *, const char *, lang_output_section_phdr_list *,
513130561Sobrien   const char *);
514130561Sobrienextern void lang_abs_symbol_at_end_of
515130561Sobrien  (const char *, const char *);
516130561Sobrienextern void lang_abs_symbol_at_beginning_of
517130561Sobrien  (const char *, const char *);
518130561Sobrienextern void lang_statement_append
519130561Sobrien  (lang_statement_list_type *, lang_statement_union_type *,
520130561Sobrien   lang_statement_union_type **);
52133965Sjdpextern void lang_for_each_input_file
522130561Sobrien  (void (*dothis) (lang_input_statement_type *));
52333965Sjdpextern void lang_for_each_file
524130561Sobrien  (void (*dothis) (lang_input_statement_type *));
525130561Sobrienextern void lang_reset_memory_regions
526130561Sobrien  (void);
527130561Sobrienextern void lang_do_assignments
528218822Sdim  (void);
52933965Sjdp
530130561Sobrien#define LANG_FOR_EACH_INPUT_STATEMENT(statement)			\
531130561Sobrien  lang_input_statement_type *statement;					\
532130561Sobrien  for (statement = (lang_input_statement_type *) file_chain.head;	\
533130561Sobrien       statement != (lang_input_statement_type *) NULL;			\
534130561Sobrien       statement = (lang_input_statement_type *) statement->next)	\
53577298Sobrien
536130561Sobrienextern void lang_process
537130561Sobrien  (void);
538130561Sobrienextern void ldlang_add_file
539130561Sobrien  (lang_input_statement_type *);
54033965Sjdpextern lang_output_section_statement_type *lang_output_section_find
541130561Sobrien  (const char * const);
542218822Sdimextern lang_output_section_statement_type *lang_output_section_find_by_flags
543218822Sdim  (const asection *, lang_output_section_statement_type **,
544218822Sdim   lang_match_sec_type_func);
545218822Sdimextern lang_output_section_statement_type *lang_insert_orphan
546218822Sdim  (asection *, const char *, lang_output_section_statement_type *,
547218822Sdim   struct orphan_save *, etree_type *, lang_statement_list_type *);
54833965Sjdpextern lang_input_statement_type *lang_add_input_file
549130561Sobrien  (const char *, lang_input_file_enum_type, const char *);
550130561Sobrienextern void lang_add_keepsyms_file
551130561Sobrien  (const char *);
55233965Sjdpextern lang_output_section_statement_type *
553130561Sobrien  lang_output_section_statement_lookup
554130561Sobrien  (const char *const);
555130561Sobrienextern void ldlang_add_undef
556130561Sobrien  (const char *const);
557130561Sobrienextern void lang_add_output_format
558130561Sobrien  (const char *, const char *, const char *, int);
559130561Sobrienextern void lang_list_init
560130561Sobrien  (lang_statement_list_type *);
561130561Sobrienextern void lang_add_data
562130561Sobrien  (int type, union etree_union *);
56333965Sjdpextern void lang_add_reloc
564130561Sobrien  (bfd_reloc_code_real_type, reloc_howto_type *, asection *, const char *,
565130561Sobrien   union etree_union *);
56633965Sjdpextern void lang_for_each_statement
567130561Sobrien  (void (*) (lang_statement_union_type *));
568130561Sobrienextern void *stat_alloc
569130561Sobrien  (size_t);
570218822Sdimextern void strip_excluded_output_sections
571218822Sdim  (void);
572130561Sobrienextern void dprint_statement
573130561Sobrien  (lang_statement_union_type *, int);
574218822Sdimextern void lang_size_sections
575218822Sdim  (bfd_boolean *, bfd_boolean);
576218822Sdimextern void one_lang_size_sections_pass
577218822Sdim  (bfd_boolean *, bfd_boolean);
578130561Sobrienextern void lang_enter_group
579130561Sobrien  (void);
580130561Sobrienextern void lang_leave_group
581130561Sobrien  (void);
58289857Sobrienextern void lang_add_section
583130561Sobrien  (lang_statement_list_type *, asection *,
584218822Sdim   lang_output_section_statement_type *);
58533965Sjdpextern void lang_new_phdr
586130561Sobrien  (const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *,
587130561Sobrien   etree_type *);
588130561Sobrienextern void lang_add_nocrossref
589130561Sobrien  (lang_nocrossref_type *);
590130561Sobrienextern void lang_enter_overlay
591130561Sobrien  (etree_type *, etree_type *);
592130561Sobrienextern void lang_enter_overlay_section
593130561Sobrien  (const char *);
59433965Sjdpextern void lang_leave_overlay_section
595130561Sobrien  (fill_type *, lang_output_section_phdr_list *);
59633965Sjdpextern void lang_leave_overlay
597130561Sobrien  (etree_type *, int, fill_type *, const char *,
598130561Sobrien   lang_output_section_phdr_list *, const char *);
59933965Sjdp
60033965Sjdpextern struct bfd_elf_version_tree *lang_elf_version_info;
60133965Sjdp
60291041Sobrienextern struct bfd_elf_version_expr *lang_new_vers_pattern
603218822Sdim  (struct bfd_elf_version_expr *, const char *, const char *, bfd_boolean);
60433965Sjdpextern struct bfd_elf_version_tree *lang_new_vers_node
605130561Sobrien  (struct bfd_elf_version_expr *, struct bfd_elf_version_expr *);
60633965Sjdpextern struct bfd_elf_version_deps *lang_add_vers_depend
607130561Sobrien  (struct bfd_elf_version_deps *, const char *);
60833965Sjdpextern void lang_register_vers_node
609130561Sobrien  (const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *);
610218822Sdimextern void lang_append_dynamic_list (struct bfd_elf_version_expr *);
611218822Sdimextern void lang_append_dynamic_list_cpp_typeinfo (void);
612218822Sdimextern void lang_append_dynamic_list_cpp_new (void);
613130561Sobrienbfd_boolean unique_section_p
614218822Sdim  (const asection *);
615130561Sobrienextern void lang_add_unique
616130561Sobrien  (const char *);
617130561Sobrienextern const char *lang_get_output_target
618130561Sobrien  (void);
619130561Sobrienextern void lang_track_definedness (const char *);
620130561Sobrienextern int lang_symbol_definition_iteration (const char *);
621130561Sobrienextern void lang_update_definedness
622130561Sobrien  (const char *, struct bfd_link_hash_entry *);
62333965Sjdp
624218822Sdimextern void add_excluded_libs (const char *);
625218822Sdimextern bfd_boolean load_symbols
626218822Sdim  (lang_input_statement_type *, lang_statement_list_type *);
627218822Sdim
628218822Sdimextern bfd_boolean
629218822Sdimldlang_override_segment_assignment
630218822Sdim  (struct bfd_link_info *, bfd *, asection *, asection *, bfd_boolean);
631218822Sdim
63233965Sjdp#endif
633