aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-03-05 22:43:40 +0000
committerAlan Modra <amodra@gmail.com>2012-03-05 22:43:40 +0000
commit66be105571d3494a28c0062f8bc663822121d838 (patch)
tree34de3a757605fafdb8ebeb907f4af86ceeb29490 /ld/ldlang.h
parentd8df103b509c3750e9702b17b8af193cb93437c7 (diff)
downloadgdb-66be105571d3494a28c0062f8bc663822121d838.zip
gdb-66be105571d3494a28c0062f8bc663822121d838.tar.gz
gdb-66be105571d3494a28c0062f8bc663822121d838.tar.bz2
* ldlang.h (struct lang_input_statement_flags): New, extract from..
(lang_input_statement_type): ..here. New field "flags". (input_flags): Declare. (missing_file): Delete. * ldmain.h (whole_archive): Delete. (add_DT_NEEDED_for_regular, add_DT_NEEDED_for_dynamic): Delete. * ld.h (ld_config_type <dynamic_link>): Delete. * ldmain.c (whole_archive): Delete. (add_DT_NEEDED_for_regular, add_DT_NEEDED_for_dynamic): Delete. * ldlang.c (missing_file, ldlang_sysrooted_script): Delete. (input_flags): New variable. Replace all uses of config.dynamic_link, missing_file, ldlang_sysrooted_script, whole_archive, add_DT_NEEDED_for_regular and add_DT_NEEDED_for_dynamic with fields from here. * ldfile.c: Likewise. * ldgram.y: Likewise. * ldmain.c: Likewise. * ldwrite.c: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/vms.em: Likewise. * ldlang.c (new_afile): Use memset to init zero fields. (load_symbols): Simplify save and restore of flags around command file processing. * ldfile.c (is_sysrooted_pathname): Tidy.
Diffstat (limited to 'ld/ldlang.h')
-rw-r--r--ld/ldlang.h65
1 files changed, 34 insertions, 31 deletions
diff --git a/ld/ldlang.h b/ld/ldlang.h
index f37409c..9ed3952 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -1,6 +1,6 @@
/* ldlang.h - linker command language support
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU Binutils.
@@ -228,36 +228,16 @@ typedef struct
bfd_vma output_offset;
} lang_reloc_statement_type;
-typedef struct lang_input_statement_struct
+struct lang_input_statement_flags
{
- lang_statement_header_type header;
- /* Name of this file. */
- const char *filename;
- /* Name to use for the symbol giving address of text start.
- Usually the same as filename, but for a file spec'd with
- -l this is the -l switch itself rather than the filename. */
- const char *local_sym_name;
-
- bfd *the_bfd;
-
- struct flag_info *section_flag_list;
-
- /* Point to the next file - whatever it is, wanders up and down
- archives */
- union lang_statement_union *next;
-
- /* Point to the next file, but skips archive contents. */
- union lang_statement_union *next_real_file;
-
- const char *target;
-
+ /* 1 means this file was specified in a -l option. */
unsigned int maybe_archive : 1;
/* 1 means search a set of directories for this file. */
- unsigned int search_dirs_flag : 1;
+ unsigned int search_dirs : 1;
/* 1 means this was found in a search directory marked as sysrooted,
- if search_dirs_flag is false, otherwise, that it should be
+ if search_dirs is false, otherwise, that it should be
searched in ld_sysroot before any other location, as long as it
starts with a slash. */
unsigned int sysrooted : 1;
@@ -265,7 +245,7 @@ typedef struct lang_input_statement_struct
/* 1 means this is base file of incremental load.
Do not load this file's text or data.
Also default text_start to after this file's bss. */
- unsigned int just_syms_flag : 1;
+ unsigned int just_syms : 1;
/* Whether to search for this entry as a dynamic archive. */
unsigned int dynamic : 1;
@@ -300,7 +280,32 @@ typedef struct lang_input_statement_struct
/* Set if reloading an --as-needed lib. */
unsigned int reload : 1;
#endif /* ENABLE_PLUGINS */
+};
+
+typedef struct lang_input_statement_struct
+{
+ lang_statement_header_type header;
+ /* Name of this file. */
+ const char *filename;
+ /* Name to use for the symbol giving address of text start.
+ Usually the same as filename, but for a file spec'd with
+ -l this is the -l switch itself rather than the filename. */
+ const char *local_sym_name;
+
+ bfd *the_bfd;
+
+ struct flag_info *section_flag_list;
+
+ /* Point to the next file - whatever it is, wanders up and down
+ archives */
+ union lang_statement_union *next;
+
+ /* Point to the next file, but skips archive contents. */
+ union lang_statement_union *next_real_file;
+
+ const char *target;
+ struct lang_input_statement_flags flags;
} lang_input_statement_type;
typedef struct
@@ -416,8 +421,6 @@ struct lang_phdr
etree_type *flags;
};
-extern struct lang_phdr *lang_phdr_list;
-
/* This structure is used to hold a list of sections which may not
cross reference each other. */
@@ -435,8 +438,6 @@ struct lang_nocrossrefs
lang_nocrossref_type *list;
};
-extern struct lang_nocrossrefs *nocrossref_list;
-
/* This structure is used to hold a list of input section names which
will not match an output section in the linker script. */
@@ -467,9 +468,12 @@ struct orphan_save
lang_output_section_statement_type **os_tail;
};
+extern struct lang_phdr *lang_phdr_list;
+extern struct lang_nocrossrefs *nocrossref_list;
extern const char *output_target;
extern lang_output_section_statement_type *abs_output_section;
extern lang_statement_list_type lang_output_section_statement;
+extern struct lang_input_statement_flags input_flags;
extern bfd_boolean lang_has_input_file;
extern etree_type *base;
extern lang_statement_list_type *stat_ptr;
@@ -482,7 +486,6 @@ extern lang_statement_list_type file_chain;
extern lang_statement_list_type input_file_chain;
extern int lang_statement_iteration;
-extern bfd_boolean missing_file;
extern void lang_init
(void);