From cd6581da62c32a391f9a4c2c5d248a11aa6fa8f7 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 9 Jan 2017 16:49:48 +0000 Subject: Speed up objdump when displaying disassembly mixed with line number and source code information. bfd * dwarf2.c (lookup_address_in_function_table): Return early if there are no functions in the given comp unit, or if the high address of the last function in the comp unit is less than the desired address. binutils * objdump.c (display_file): Add new parameter 'last_file'. If last_file is true, do not call bfd_close at the end of the function. (main): Set the value of the last_file parameter when calling display_file. --- bfd/ChangeLog | 7 +++++++ bfd/dwarf2.c | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 933feba..83a7116 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2017-01-09 Nick Clifton + * dwarf2.c (lookup_address_in_function_table): Return early if + there are no functions in the given comp unit, or if the high + address of the last function in the comp unit is less than the + desired address. + +2017-01-09 Nick Clifton + PR binutils/21013 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error message if there are too many symbols to load. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index b477d27..40edd91 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -2336,9 +2336,15 @@ lookup_address_in_function_table (struct comp_unit *unit, bfd_size_type low, high, mid, first; struct arange *arange; + if (number_of_functions == 0) + return FALSE; + if (!build_lookup_funcinfo_table (unit)) return FALSE; + if (unit->lookup_funcinfo_table[number_of_functions - 1].high_addr < addr) + return FALSE; + /* Find the first function in the lookup table which may contain the specified address. */ low = 0; -- cgit v1.1