summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils-2.17/ld
diff options
context:
space:
mode:
authorStefan Kempf <stefan@cvs.openbsd.org>2016-05-31 17:05:05 +0000
committerStefan Kempf <stefan@cvs.openbsd.org>2016-05-31 17:05:05 +0000
commit733409e466c16a6664f6335d8c42f3dd46282923 (patch)
treefdf6e2a50674804b65094b371e82cc4520153f46 /gnu/usr.bin/binutils-2.17/ld
parentb28ed2ea23be8bad6ecef6234d40f511bb38aaf6 (diff)
Port over binutils fix for PR ld/3111.
This greatly speeds up up linking of object files that contain lots of dwarf2 symbols by caching symbol tables. Original patch before binutils was switched to GPLv3 from: https://sourceware.org/ml/binutils/2006-08/msg00334.html Aaron Miller made us aware of that diff and adapted it to our in-tree binutils. Many thanks! Ports build testing on amd64 by krw@ ok deraadt@ krw@
Diffstat (limited to 'gnu/usr.bin/binutils-2.17/ld')
-rw-r--r--gnu/usr.bin/binutils-2.17/ld/ld.h5
-rw-r--r--gnu/usr.bin/binutils-2.17/ld/ldlang.c8
-rw-r--r--gnu/usr.bin/binutils-2.17/ld/ldmain.c2
-rw-r--r--gnu/usr.bin/binutils-2.17/ld/lexsup.c2
4 files changed, 6 insertions, 11 deletions
diff --git a/gnu/usr.bin/binutils-2.17/ld/ld.h b/gnu/usr.bin/binutils-2.17/ld/ld.h
index bf4e50351a5..6c6b3b13284 100644
--- a/gnu/usr.bin/binutils-2.17/ld/ld.h
+++ b/gnu/usr.bin/binutils-2.17/ld/ld.h
@@ -200,11 +200,6 @@ typedef struct {
behaviour of the linker. The new default behaviour is to reject such
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;
diff --git a/gnu/usr.bin/binutils-2.17/ld/ldlang.c b/gnu/usr.bin/binutils-2.17/ld/ldlang.c
index 099a4ccb507..a1a9682d1ab 100644
--- a/gnu/usr.bin/binutils-2.17/ld/ldlang.c
+++ b/gnu/usr.bin/binutils-2.17/ld/ldlang.c
@@ -1670,7 +1670,7 @@ lang_map (void)
fprintf (config.map_file, _("\nLinker script and memory map\n\n"));
- if (! command_line.reduce_memory_overheads)
+ if (! link_info.reduce_memory_overheads)
{
obstack_begin (&map_obstack, 1000);
for (p = link_info.input_bfds; p != (bfd *) NULL; p = p->link_next)
@@ -1746,7 +1746,7 @@ init_os (lang_output_section_statement_type *s, asection *isec)
}
s->bfd_section->output_section = s->bfd_section;
s->bfd_section->output_offset = 0;
- if (!command_line.reduce_memory_overheads)
+ if (!link_info.reduce_memory_overheads)
{
fat_section_userdata_type *new
= stat_alloc (sizeof (fat_section_userdata_type));
@@ -1840,7 +1840,7 @@ section_already_linked (bfd *abfd, asection *sec, void *data)
}
if (!(abfd->flags & DYNAMIC))
- bfd_section_already_linked (abfd, sec);
+ bfd_section_already_linked (abfd, sec, &link_info);
}
/* The wild routines.
@@ -3564,7 +3564,7 @@ print_input_section (asection *i)
if (i->output_section != NULL && i->output_section->owner == output_bfd)
{
- if (command_line.reduce_memory_overheads)
+ if (link_info.reduce_memory_overheads)
bfd_link_hash_traverse (link_info.hash, print_one_symbol, i);
else
print_all_symbols (i);
diff --git a/gnu/usr.bin/binutils-2.17/ld/ldmain.c b/gnu/usr.bin/binutils-2.17/ld/ldmain.c
index 1fee6f8673c..db8fae7398d 100644
--- a/gnu/usr.bin/binutils-2.17/ld/ldmain.c
+++ b/gnu/usr.bin/binutils-2.17/ld/ldmain.c
@@ -261,7 +261,6 @@ main (int argc, char **argv)
command_line.warn_mismatch = TRUE;
command_line.check_section_addresses = TRUE;
command_line.accept_unknown_input_arch = FALSE;
- command_line.reduce_memory_overheads = FALSE;
sort_section = none;
@@ -325,6 +324,7 @@ main (int argc, char **argv)
link_info.relax_pass = 1;
link_info.warn_shared_textrel = FALSE;
link_info.gc_sections = FALSE;
+ link_info.reduce_memory_overheads = FALSE;
ldfile_add_arch ("");
diff --git a/gnu/usr.bin/binutils-2.17/ld/lexsup.c b/gnu/usr.bin/binutils-2.17/ld/lexsup.c
index 654edb52f27..dda6ffe861f 100644
--- a/gnu/usr.bin/binutils-2.17/ld/lexsup.c
+++ b/gnu/usr.bin/binutils-2.17/ld/lexsup.c
@@ -1350,7 +1350,7 @@ parse_args (unsigned argc, char **argv)
break;
case OPTION_REDUCE_MEMORY_OVERHEADS:
- command_line.reduce_memory_overheads = TRUE;
+ link_info.reduce_memory_overheads = TRUE;
if (config.hash_table_size == 0)
config.hash_table_size = 1021;
break;