aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-05-07 15:04:53 +0000
committerAlan Modra <amodra@gmail.com>2007-05-07 15:04:53 +0000
commit3b95049e0a52a4b831c5338aa844d97df5e05df4 (patch)
treee78867b7743bba9aaa7a914756d7e6bbc40917c1
parent1182cb939773001f430e98baf146340e27f98f59 (diff)
downloadgdb-3b95049e0a52a4b831c5338aa844d97df5e05df4.zip
gdb-3b95049e0a52a4b831c5338aa844d97df5e05df4.tar.gz
gdb-3b95049e0a52a4b831c5338aa844d97df5e05df4.tar.bz2
* ld.h (args_type, ld_config_type): Reorder fields.
* ldmain.c (main): Don't initialise a bunch of vars we know are zero already.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/ld.h80
-rw-r--r--ld/ldmain.c71
3 files changed, 51 insertions, 106 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 68fdee1..3a7e751 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.h (args_type, ld_config_type): Reorder fields.
+ * ldmain.c (main): Don't initialise a bunch of vars we know are
+ zero already.
+
2007-05-05 Anatoly Sokolov <aesok@post.ru>
* multempl/avrelf.em (PARSE_AND_LIST_ARGS_CASES): Add new value for
diff --git a/ld/ld.h b/ld/ld.h
index 96b9b8d..fd7301b 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -147,22 +147,6 @@ typedef struct {
bfd_boolean inhibit_common_definition;
bfd_boolean relax;
- /* Name of runtime interpreter to invoke. */
- char *interpreter;
-
- /* Name to give runtime libary from the -soname argument. */
- char *soname;
-
- /* Runtime library search path from the -rpath argument. */
- char *rpath;
-
- /* Link time runtime library search path from the -rpath-link
- argument. */
- char *rpath_link;
-
- /* Big or little endian as set on command line. */
- enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
-
/* If TRUE, build MIPS embedded PIC relocation tables in the output
file. */
bfd_boolean embedded_relocs;
@@ -181,20 +165,6 @@ typedef struct {
search. */
bfd_boolean warn_search_mismatch;
- /* Name of shared object whose symbol table should be filtered with
- this shared object. From the --filter option. */
- char *filter_shlib;
-
- /* Name of shared object for whose symbol table this shared object
- is an auxiliary filter. From the --auxiliary option. */
- char **auxiliary_filters;
-
- /* A version symbol to be applied to the symbol names found in the
- .exports sections. */
- char *version_exports_section;
-
- /* Default linker script. */
- char *default_script;
/* If TRUE (the default) check section addresses, once compute,
fpor overlaps. */
@@ -206,6 +176,9 @@ typedef struct {
input files. */
bfd_boolean accept_unknown_input_arch;
+ /* Big or little endian as set on command line. */
+ enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
+
/* -Bsymbolic and -Bsymbolic-functions, as set on command line. */
enum
{
@@ -222,6 +195,34 @@ typedef struct {
dynamic_list_data,
dynamic_list
} dynamic_list;
+
+ /* Name of runtime interpreter to invoke. */
+ char *interpreter;
+
+ /* Name to give runtime libary from the -soname argument. */
+ char *soname;
+
+ /* Runtime library search path from the -rpath argument. */
+ char *rpath;
+
+ /* Link time runtime library search path from the -rpath-link
+ argument. */
+ char *rpath_link;
+
+ /* Name of shared object whose symbol table should be filtered with
+ this shared object. From the --filter option. */
+ char *filter_shlib;
+
+ /* Name of shared object for whose symbol table this shared object
+ is an auxiliary filter. From the --auxiliary option. */
+ char **auxiliary_filters;
+
+ /* A version symbol to be applied to the symbol names found in the
+ .exports sections. */
+ char *version_exports_section;
+
+ /* Default linker script. */
+ char *default_script;
} args_type;
extern args_type command_line;
@@ -229,7 +230,6 @@ extern args_type command_line;
typedef int token_code_type;
typedef struct {
- bfd_size_type specified_data_size;
bfd_boolean magic_demand_paged;
bfd_boolean make_executable;
@@ -269,24 +269,26 @@ typedef struct {
bfd_boolean text_read_only;
- char *map_filename;
- FILE *map_file;
-
bfd_boolean stats;
/* If set, orphan input sections will be mapped to separate output
sections. */
bfd_boolean unique_orphan_sections;
- unsigned int split_by_reloc;
- bfd_size_type split_by_file;
+ /* If set, only search library directories explicitly selected
+ on the command line. */
+ bfd_boolean only_cmd_line_lib_dirs;
/* The rpath separation character. Usually ':'. */
char rpath_separator;
- /* If set, only search library directories explicitly selected
- on the command line. */
- bfd_boolean only_cmd_line_lib_dirs;
+ char *map_filename;
+ FILE *map_file;
+
+ unsigned int split_by_reloc;
+ bfd_size_type split_by_file;
+
+ bfd_size_type specified_data_size;
/* The size of the hash table to use. */
bfd_size_type hash_table_size;
diff --git a/ld/ldmain.c b/ld/ldmain.c
index ccbc8bb..bbd769f 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -242,28 +242,17 @@ main (int argc, char **argv)
}
#endif
- /* Initialize the data about options. */
- trace_files = trace_file_tries = version_printed = FALSE;
- whole_archive = FALSE;
config.build_constructors = TRUE;
- config.dynamic_link = FALSE;
- config.has_shared = FALSE;
config.rpath_separator = ':';
config.split_by_reloc = (unsigned) -1;
config.split_by_file = (bfd_size_type) -1;
- config.hash_table_size = 0;
- command_line.force_common_definition = FALSE;
- command_line.inhibit_common_definition = FALSE;
- command_line.interpreter = NULL;
- command_line.rpath = NULL;
+ config.make_executable = TRUE;
+ config.magic_demand_paged = TRUE;
+ config.text_read_only = TRUE;
+
command_line.warn_mismatch = TRUE;
command_line.warn_search_mismatch = TRUE;
command_line.check_section_addresses = TRUE;
- command_line.accept_unknown_input_arch = FALSE;
- command_line.symbolic = symbolic_unset;
- command_line.dynamic_list = dynamic_list_unset;
-
- sort_section = none;
/* We initialize DEMANGLING based on the environment variable
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
@@ -272,73 +261,21 @@ main (int argc, char **argv)
interface by default. */
demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL;
- link_info.relocatable = FALSE;
- link_info.emitrelocations = FALSE;
- link_info.task_link = FALSE;
- link_info.shared = FALSE;
- link_info.pie = FALSE;
- link_info.executable = FALSE;
- link_info.symbolic = FALSE;
- link_info.export_dynamic = FALSE;
- link_info.static_link = FALSE;
- link_info.traditional_format = FALSE;
- link_info.optimize = FALSE;
- link_info.unresolved_syms_in_objects = RM_NOT_YET_SET;
- link_info.unresolved_syms_in_shared_libs = RM_NOT_YET_SET;
- link_info.allow_multiple_definition = FALSE;
link_info.allow_undefined_version = TRUE;
- link_info.create_default_symver = FALSE;
- link_info.default_imported_symver = FALSE;
link_info.keep_memory = TRUE;
- link_info.notice_all = FALSE;
- link_info.nocopyreloc = FALSE;
- link_info.new_dtags = FALSE;
link_info.combreloc = TRUE;
- link_info.eh_frame_hdr = FALSE;
- link_info.relro = FALSE;
link_info.strip_discarded = TRUE;
- link_info.strip = strip_none;
- link_info.discard = discard_sec_merge;
- link_info.common_skip_ar_aymbols = bfd_link_common_skip_none;
link_info.callbacks = &link_callbacks;
- link_info.hash = NULL;
- link_info.keep_hash = NULL;
- link_info.notice_hash = NULL;
- link_info.wrap_hash = NULL;
- link_info.input_bfds = NULL;
- link_info.create_object_symbols_section = NULL;
- link_info.gc_sym_list = NULL;
- link_info.base_file = NULL;
link_info.emit_hash = TRUE;
- link_info.emit_gnu_hash = FALSE;
/* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init
and _fini symbols. We are compatible. */
link_info.init_function = "_init";
link_info.fini_function = "_fini";
link_info.pei386_auto_import = -1;
- link_info.pei386_runtime_pseudo_reloc = FALSE;
link_info.spare_dynamic_tags = 5;
- link_info.flags = 0;
- link_info.flags_1 = 0;
link_info.relax_pass = 1;
- link_info.warn_shared_textrel = FALSE;
- link_info.gc_sections = FALSE;
- link_info.print_gc_sections = FALSE;
- link_info.dynamic = FALSE;
- link_info.dynamic_list = NULL;
- link_info.dynamic_data = FALSE;
- link_info.reduce_memory_overheads = FALSE;
-
- config.maxpagesize = 0;
- config.commonpagesize = 0;
ldfile_add_arch ("");
-
- config.make_executable = TRUE;
- force_make_executable = FALSE;
- config.magic_demand_paged = TRUE;
- config.text_read_only = TRUE;
-
emulation = get_emulation (argc, argv);
ldemul_choose_mode (emulation);
default_target = ldemul_choose_target (argc, argv);