aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-03-30 14:41:31 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-03-30 14:41:31 +0000
commitd460e92e4111484ffb8b6e898fde7adb619e4722 (patch)
treedff9d6449ef01b235ecf23cc30a376b1551c4b87
parent87d32bb7b0faf1de5a5f8d2b9a7b6a398a431cc8 (diff)
downloadgdb-d460e92e4111484ffb8b6e898fde7adb619e4722.zip
gdb-d460e92e4111484ffb8b6e898fde7adb619e4722.tar.gz
gdb-d460e92e4111484ffb8b6e898fde7adb619e4722.tar.bz2
gas/testsuite:
* gas/arm/mapsecs.d, gas/arm/mapsecs.s: New. opcodes: * arm-dis.c (print_insn): Also check section matches in backwards search for mapping symbol.
-rw-r--r--gas/testsuite/ChangeLog4
-rw-r--r--gas/testsuite/gas/arm/mapsecs.d45
-rw-r--r--gas/testsuite/gas/arm/mapsecs.s15
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/arm-dis.c4
5 files changed, 72 insertions, 1 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 5495eea..b881c61 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-03-30 Joseph Myers <joseph@codesourcery.com>
+
+ * gas/arm/mapsecs.d, gas/arm/mapsecs.s: New.
+
2009-03-26 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* gas/arm/wince_inst.d: Convert to unified syntax.
diff --git a/gas/testsuite/gas/arm/mapsecs.d b/gas/testsuite/gas/arm/mapsecs.d
new file mode 100644
index 0000000..52bca8c
--- /dev/null
+++ b/gas/testsuite/gas/arm/mapsecs.d
@@ -0,0 +1,45 @@
+#as: -EL
+#objdump: --syms --special-syms -d
+#name: ARM Mapping Symbols with multiple sections
+# This test is only valid on EABI based ports.
+#target: *-*-*eabi *-*-symbianelf *-*-linux-* *-*-elf
+#source: mapsecs.s
+
+
+.*: +file format .*arm.*
+
+SYMBOL TABLE:
+0+00 l d .text 00000000 .text
+0+00 l d .data 00000000 .data
+0+00 l d .bss 00000000 .bss
+0+00 l d .text.f1 00000000 .text.f1
+0+00 l F .text.f1 00000000 f1
+0+00 l .text.f1 00000000 \$a
+0+08 l .text.f1 00000000 f1a
+0+00 l d .text.f2 00000000 .text.f2
+0+00 l F .text.f2 00000000 f2
+0+00 l .text.f2 00000000 \$a
+0+04 l .text.f2 00000000 \$d
+0+08 l .text.f2 00000000 f2a
+0+08 l .text.f2 00000000 \$a
+0+00 l d .ARM.attributes 00000000 .ARM.attributes
+
+
+
+Disassembly of section .text.f1:
+
+00000000 <f1>:
+ 0: e1a00000 nop \(mov r0,r0\)
+ 4: e1a00000 nop \(mov r0,r0\)
+
+00000008 <f1a>:
+ 8: e1a00000 nop \(mov r0,r0\)
+
+Disassembly of section .text.f2:
+
+00000000 <f2>:
+ 0: e1a00000 nop \(mov r0,r0\)
+ 4: 00000001 .word 0x00000001
+
+00000008 <f2a>:
+ 8: e1a00000 nop \(mov r0,r0\)
diff --git a/gas/testsuite/gas/arm/mapsecs.s b/gas/testsuite/gas/arm/mapsecs.s
new file mode 100644
index 0000000..005c339
--- /dev/null
+++ b/gas/testsuite/gas/arm/mapsecs.s
@@ -0,0 +1,15 @@
+ .text
+ .section .text.f1,"ax",%progbits
+ .type f1, %function
+f1:
+ nop
+ nop
+f1a:
+ nop
+ .section .text.f2,"ax",%progbits
+ .type f2, %function
+f2:
+ nop
+ .word 1
+f2a:
+ nop
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index fb917ce..a98f288 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-30 Joseph Myers <joseph@codesourcery.com>
+
+ * arm-dis.c (print_insn): Also check section matches in backwards
+ search for mapping symbol.
+
2009-03-26 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (get_valid_dis386): Abort on unhandled table.
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index aedc9f2..3360b82 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -4041,7 +4041,9 @@ print_insn (bfd_vma pc, struct disassemble_info *info, bfd_boolean little)
for a preceeding one. */
for (; n >= 0; n--)
{
- if (get_sym_code_type (info, n, &type))
+ if ((info->section == NULL
+ || info->section == info->symtab[n]->section)
+ && get_sym_code_type (info, n, &type))
{
last_sym = n;
found = TRUE;