summaryrefslogtreecommitdiff
path: root/ld/ld.h
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@arc.com>2004-05-19 14:15:55 +0000
committerJoern Rennecke <joern.rennecke@arc.com>2004-05-19 14:15:55 +0000
commiteb70466eb4aabe2278381e0ad82f52d19122ea05 (patch)
tree4b7a18e94cf01a8e27c67d70bc74635a4f6dcafa /ld/ld.h
parentd5d8cfb7aae27a953ef33d038288b3220f8bc16d (diff)
downloadbinutils-redhat-eb70466eb4aabe2278381e0ad82f52d19122ea05.tar.gz
* NEWS: Mention new linker map file generation and the
--reduce-memory-overheads option. * ld.texinfo: Document --reduce-memory-overheads option. * ld.h (map_symbol_def): New struct. (struct user_section_struct, section_userdata_type): Rename to: (struct lean_user_section_struct, lean_section_userdata_type). (struct fat_user_section_struct, fat_section_userdata_type): New. (SECTION_USERDATA_SIZE): Define. (args_type): New member reduce_memory_overheads. * ldlang.c (map_obstack): New static variable. (init_map_userdata, print_all_symbols, sort_def_symbol): New functions. (lang_map): Unless command_line.reduce_memory_overheads is set, initialize lists of defined symbols for each section. (print_input_section): Unless command_line.reduce_memory_overheads is set, use print_all_symbols. (init_os): Use lean_section_userdata_type / SECTION_USERDATA_SIZE. * ldmain.c (main): Initialize command_line.reduce_memory_overheads. * lexsup.c (enum option_values): Add OPTION_REDUCE_MEMORY_OVERHEADS. (ld_options): Add entry for --reduce-memory-overheads. (parse_args): Handle OPTION_REDUCE_MEMORY_OVERHEADS.
Diffstat (limited to 'ld/ld.h')
-rw-r--r--ld/ld.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/ld/ld.h b/ld/ld.h
index dde4cfe234..1061c35968 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -78,11 +78,32 @@ struct wildcard_list {
struct wildcard_spec spec;
};
+struct map_symbol_def {
+ struct bfd_link_hash_entry *entry;
+ struct map_symbol_def *next;
+};
+
/* Extra information we hold on sections */
-typedef struct user_section_struct {
- /* Pointer to the section where this data will go */
+typedef struct lean_user_section_struct {
+ /* For output sections: pointer to the section where this data will go. */
+ struct lang_input_statement_struct *file;
+} lean_section_userdata_type;
+
+/* The initial part of fat_user_section_struct has to be idential with
+ lean_user_section_struct. */
+typedef struct fat_user_section_struct {
+ /* For output sections: pointer to the section where this data will go. */
struct lang_input_statement_struct *file;
-} section_userdata_type;
+ /* For input sections, when writing a map file: head / tail of a linked
+ list of hash table entries for symbols defined in this section. */
+ struct map_symbol_def *map_symbol_def_head;
+ struct map_symbol_def **map_symbol_def_tail;
+} fat_section_userdata_type;
+
+#define SECTION_USERDATA_SIZE \
+ (command_line.reduce_memory_overheads \
+ ? sizeof (lean_section_userdata_type) \
+ : sizeof (fat_section_userdata_type))
#define get_userdata(x) ((x)->userdata)
@@ -154,6 +175,10 @@ typedef struct {
input files. */
bfd_boolean accept_unknown_input_arch;
+ /* If TRUE reduce memory overheads, at the expense of speed.
+ This will cause map file generation to use an O(N^2) algorithm. */
+ bfd_boolean reduce_memory_overheads;
+
} args_type;
extern args_type command_line;