aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-01-09 16:49:48 +0000
committerNick Clifton <nickc@redhat.com>2017-01-09 16:49:48 +0000
commitcd6581da62c32a391f9a4c2c5d248a11aa6fa8f7 (patch)
tree7918cbf311b6e85e5050fa58676060a4957e5f60 /bfd/dwarf2.c
parent20b52c88ea31f8a0af60d6172ab0da5f2ad616ee (diff)
downloadgdb-cd6581da62c32a391f9a4c2c5d248a11aa6fa8f7.zip
gdb-cd6581da62c32a391f9a4c2c5d248a11aa6fa8f7.tar.gz
gdb-cd6581da62c32a391f9a4c2c5d248a11aa6fa8f7.tar.bz2
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.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c6
1 files changed, 6 insertions, 0 deletions
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;