From: Alan Modra <amodra@bigpond.net.au>
To: binutils@sourceware.org
Subject: misc ldlang.c tweaks
Date: Tue, 06 Jun 2006 02:49:00 -0000 [thread overview]
Message-ID: <20060606022400.GE519@bubble.grove.modra.org> (raw)
Fixes a buglet in map_input_to_output_sections. lang_input_section
statements are created in the process of mapping files, and must
therefore already have an initialised output section. There is no
need to call init_os for this statement type. (Not that it causes any
harm besides minutely slowing down the linker.)
* ldlang.c (init_os): Whitespace.
(map_input_to_output_sections): Don't init_os for lang_input_section.
(print_all_symbols): Remove forward declaration. Convert to ISO C.
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.220
diff -u -p -r1.220 ldlang.c
--- ld/ldlang.c 5 Jun 2006 06:12:40 -0000 1.220
+++ ld/ldlang.c 6 Jun 2006 02:13:36 -0000
@@ -74,7 +74,6 @@ static bfd_boolean load_symbols (lang_in
static struct bfd_hash_entry *lang_definedness_newfunc
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
static void insert_undefined (const char *);
-static void print_all_symbols (asection *);
static bfd_boolean sort_def_symbol (struct bfd_link_hash_entry *, void *);
static void print_statement (lang_statement_union_type *,
lang_output_section_statement_type *);
@@ -1742,6 +1741,7 @@ init_os (lang_output_section_statement_t
}
s->bfd_section->output_section = s->bfd_section;
s->bfd_section->output_offset = 0;
+
if (!command_line.reduce_memory_overheads)
{
fat_section_userdata_type *new
@@ -1750,7 +1750,6 @@ init_os (lang_output_section_statement_t
get_userdata (s->bfd_section) = new;
}
-
/* If there is a base address, make sure that any sections it might
mention are initialized. */
if (s->addr_tree != NULL)
@@ -3152,8 +3151,9 @@ map_input_to_output_sections
if (!(os->flags & SEC_NEVER_LOAD))
os->bfd_section->flags |= SEC_ALLOC | SEC_LOAD;
break;
- case lang_fill_statement_enum:
case lang_input_section_enum:
+ break;
+ case lang_fill_statement_enum:
case lang_object_symbols_statement_enum:
case lang_reloc_statement_enum:
case lang_padding_statement_enum:
@@ -3481,8 +3481,7 @@ print_one_symbol (struct bfd_link_hash_e
}
static void
-print_all_symbols (sec)
- asection *sec;
+print_all_symbols (asection *sec)
{
struct fat_user_section_struct *ud = get_userdata (sec);
struct map_symbol_def *def;
--
Alan Modra
IBM OzLabs - Linux Technology Centre
reply other threads:[~2006-06-06 2:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060606022400.GE519@bubble.grove.modra.org \
--to=amodra@bigpond.net.au \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).