summaryrefslogtreecommitdiff
path: root/ld/ldlang.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-01-16 11:47:25 +1030
committerAlan Modra <amodra@gmail.com>2014-01-16 11:56:51 +1030
commit6fcc66ab70d67efb1a8b96532b5eb96883caa727 (patch)
tree814bac8e40cf8b8621a2c85d2d8bbd99d90f77c6 /ld/ldlang.h
parentb75d42bce5609effad86fb8b5d902f4c337e0cf9 (diff)
downloadbinutils-gdb-6fcc66ab70d67efb1a8b96532b5eb96883caa727.tar.gz
Tidy ld use of bfd_section userdata.
A long time ago ld made use of userdata to tie an output section to its lang_input_statement_struct object file. Some time later Joern made map file printing of symbols at lot faster, using userdata on input sections. That complicated allocation of userdata, and when the output section use disappeared a year later, the code wasn't properly cleaned up. This patch does that cleanup, and also tidies the symbol printing code to not allocate userdata where it won't be needed. We don't print symbols defined in the absolute section or in output sections. * ld.h (fat_section_userdata_type, get_userdata): Move to.. * ldlang.h (input_section_userdata_type, get_userdata): ..here. * ldlang.c (init_map_userdata): Delete. Fold into.. (sort_def_symbol): ..here. Don't attach input section userdata to output sections or global bfd sections. (lang_map): Don't pre-allocate input section userdata. (init_os): Don't allocate userdata for output sections. (print_all_symbols): Update.
Diffstat (limited to 'ld/ldlang.h')
-rw-r--r--ld/ldlang.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 2dbec5a413b..6eb75dcff6e 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -313,6 +313,18 @@ typedef struct
asection *section;
} lang_input_section_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. */
+typedef struct input_section_userdata_struct
+{
+ struct map_symbol_def *map_symbol_def_head;
+ struct map_symbol_def **map_symbol_def_tail;
+ unsigned long map_symbol_def_count;
+} input_section_userdata_type;
+
+#define get_userdata(x) ((x)->userdata)
+
+
typedef struct lang_wild_statement_struct lang_wild_statement_type;
typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,