/* ldlang.h - linker command language support
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
You should have received a copy of the GNU General Public License
along with GLD; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LDLANG_H
#define LDLANG_H
union etree_union *addr_tree;
lang_statement_list_type children;
const char *memspec;
- union lang_statement_union *next;
+ struct lang_output_section_statement_struct *next;
const char *name;
int processed;
int subsection_alignment; /* Alignment of components. */
int section_alignment; /* Alignment of start of section. */
int constraint;
- bfd_boolean all_input_readonly;
+ unsigned int all_input_readonly : 1;
+ unsigned int ignored : 1;
union etree_union *load_base;
/* Whether to search for this entry as a dynamic archive. */
bfd_boolean dynamic;
+ /* Whether DT_NEEDED tags should be added for dynamic libraries in
+ DT_NEEDED tags from this entry. */
+ bfd_boolean add_needed;
+
/* Whether this entry should cause a DT_NEEDED tag only when
satisfying references from regular files, or always. */
bfd_boolean as_needed;
bfd_boolean loaded;
-#if 0
- unsigned int globals_in_this_file;
-#endif
const char *target;
bfd_boolean real;
} lang_input_statement_type;
union lang_statement_union *file;
} lang_afile_asection_pair_statement_type;
-typedef struct lang_wild_statement_struct
+typedef struct lang_wild_statement_struct lang_wild_statement_type;
+
+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
+ asection *, lang_input_statement_type *, void *);
+
+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
+ lang_input_statement_type *,
+ callback_t callback,
+ void *data);
+
+struct lang_wild_statement_struct
{
lang_statement_header_type header;
const char *filename;
struct wildcard_list *section_list;
bfd_boolean keep_sections;
lang_statement_list_type children;
-} lang_wild_statement_type;
+
+ walk_wild_section_handler_t walk_wild_section_handler;
+ struct wildcard_list *handler_data[4];
+};
typedef struct lang_address_statement_struct
{
lang_statement_header_type header;
const char *section_name;
union etree_union *address;
+ const segment_type *segment;
} lang_address_statement_type;
typedef struct
int iteration;
};
-extern struct unique_sections *unique_section_list;
+/* Used by place_orphan to keep track of orphan sections and statements. */
+
+struct orphan_save {
+ const char *name;
+ flagword flags;
+ lang_output_section_statement_type *os;
+ asection **section;
+ lang_statement_union_type **stmt;
+ lang_output_section_statement_type **os_tail;
+};
extern lang_output_section_statement_type *abs_output_section;
extern lang_statement_list_type lang_output_section_statement;
extern void lang_process
(void);
extern void lang_section_start
- (const char *, union etree_union *);
+ (const char *, union etree_union *, const segment_type *);
extern void lang_add_entry
(const char *, bfd_boolean);
+extern void lang_default_entry
+ (const char *);
extern void lang_add_target
(const char *);
extern void lang_add_wild
extern void lang_reset_memory_regions
(void);
extern void lang_do_assignments
- (lang_statement_union_type *, lang_output_section_statement_type *,
- fill_type *, bfd_vma);
+ (void);
#define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
lang_input_statement_type *statement; \
(lang_input_statement_type *);
extern lang_output_section_statement_type *lang_output_section_find
(const char * const);
+extern lang_output_section_statement_type *lang_output_section_find_by_flags
+ (const asection *, lang_output_section_statement_type **exact);
+extern lang_output_section_statement_type *lang_insert_orphan
+ (lang_input_statement_type *, asection *, const char *,
+ lang_output_section_statement_type *, struct orphan_save *,
+ etree_type *, lang_statement_list_type *);
extern lang_input_statement_type *lang_add_input_file
(const char *, lang_input_file_enum_type, const char *);
extern void lang_add_keepsyms_file
(void (*) (lang_statement_union_type *));
extern void *stat_alloc
(size_t);
+extern void strip_excluded_output_sections
+ (void);
extern void dprint_statement
(lang_statement_union_type *, int);
-extern bfd_vma lang_size_sections
- (lang_statement_union_type *, lang_output_section_statement_type *,
- lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *,
- bfd_boolean);
+extern void lang_size_sections
+ (bfd_boolean *, bfd_boolean);
+extern void one_lang_size_sections_pass
+ (bfd_boolean *, bfd_boolean);
extern void lang_enter_group
(void);
extern void lang_leave_group
extern void lang_update_definedness
(const char *, struct bfd_link_hash_entry *);
+extern void add_excluded_libs (const char *);
+
#endif