From 6fcc66ab70d67efb1a8b96532b5eb96883caa727 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 16 Jan 2014 11:47:25 +1030 Subject: 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. --- ld/ld.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'ld/ld.h') diff --git a/ld/ld.h b/ld/ld.h index 4acb721..e3ef107 100644 --- a/ld/ld.h +++ b/ld/ld.h @@ -109,18 +109,6 @@ struct map_symbol_def { struct map_symbol_def *next; }; -/* The initial part of fat_user_section_struct has to be idential with - lean_user_section_struct. */ -typedef struct fat_user_section_struct { - /* 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; - unsigned long map_symbol_def_count; -} fat_section_userdata_type; - -#define get_userdata(x) ((x)->userdata) - #define BYTE_SIZE (1) #define SHORT_SIZE (2) #define LONG_SIZE (4) -- cgit v1.1