summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-05-11 09:41:21 +0000
committerNick Clifton <nickc@redhat.com>2012-05-11 09:41:21 +0000
commit1ee37781613f20a35655f467153b9240104db5ff (patch)
tree97f510ab27d5f0074a2ebb69709b0c634debe336
parentfa49244192b342f9812b3684dfb9d8c908536eb2 (diff)
downloadgdb-1ee37781613f20a35655f467153b9240104db5ff.tar.gz
PR binutils/14006
* arm-dis.c (print_insn): Fix detection of instruction mode in files containing multiple executable sections.
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/arm-dis.c16
2 files changed, 19 insertions, 3 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index a43dd3d3dac..c1cc70b6c38 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-11 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/14006
+ * arm-dis.c (print_insn): Fix detection of instruction mode in
+ files containing multiple executable sections.
+
2012-05-03 Sean Keys <skeys@ipdatasys.com>
* Makefile.in, configure: regenerate
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 03062ad4d94..1269cf726ac 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -4697,9 +4697,19 @@ print_insn (bfd_vma pc, struct disassemble_info *info, bfd_boolean little)
/* Start scanning at the start of the function, or wherever
we finished last time. */
- start = info->symtab_pos + 1;
- if (start < private_data->last_mapping_sym)
- start = private_data->last_mapping_sym;
+ /* PR 14006. When the address is 0 we are either at the start of the
+ very first function, or else the first function in a new, unlinked
+ executable section (eg because uf -ffunction-sections). Either way
+ start scanning from the beginning of the symbol table, not where we
+ left off last time. */
+ if (pc == 0)
+ start = 0;
+ else
+ {
+ start = info->symtab_pos + 1;
+ if (start < private_data->last_mapping_sym)
+ start = private_data->last_mapping_sym;
+ }
found = FALSE;
/* First, look for mapping symbols. */