This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ARM Disassembler fix
Hi Pedro,
Pedro Alves wrote:
On Tuesday 05 January 2010 22:17:46, Daniel Gutson wrote:
Hi Pedro,
Pedro Alves wrote:
On Monday 04 January 2010 20:43:29, Daniel Gutson wrote:
The patch breaks text disassembly on arm non-elf targets. Could
this be restrict to elf, please?
I now restricted the value initialization of is_data depending on the
obj flavour.
Thanks.
ChangeLog is the same.
(I suggest always pasting the changelog with the patch, even
when it doesn't change between revisions; it makes it easier
for the person doing the actual reviewing [and maybe commit]
to have everything in one place.)
Please let me know how does this look now.
The new test is now surely failing on non-elf targets. :-)
Could you skip it, please? Something like this should do it:
#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
DONE. (this is the only difference compared against the last patch).
ChangeLog:
2010-01-05 Daniel Gutson <dgutson@codesourcery.com>
opcodes/
* arm-dis.c (print_insn): Fixed search for next
symbol and data dumping condition, and the
initial mapping symbol state.
gas/testsuite/
* gas/arm/dis-data.d: New test case.
* gas/arm/dis-data.s: New file.
--
Daniel Gutson
CodeSourcery
www.codesourcery.com
? 6338_upstream.patch
? alignment_spec.patch
? disasm.patch
? disasm_arm_v2.patch
? disasm_arm_v3.patch
Index: gas/ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.4059
diff -u -p -r1.4059 ChangeLog
--- gas/ChangeLog 4 Jan 2010 23:31:03 -0000 1.4059
+++ gas/ChangeLog 6 Jan 2010 00:49:36 -0000
@@ -1,4 +1,13 @@
+<<<<<<< ChangeLog
+2009-12-28 Daniel Gutson <dgutson@codesourcery.com>
+
+ * doc/c-arm.texi: Document NEON alignment specifiers.
+
+2009-12-21 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+ Richard Earnshaw <richard.earnshaw@arm.com>
+=======
2010-01-04 Daniel Gutson <dgutson@codesourcery.com>
+>>>>>>> 1.4058
* config/tc-arm.c (do_neon_logic): Accept imm value
in the third operand too.
Index: gas/testsuite/gas/arm/dis-data.d
===================================================================
RCS file: gas/testsuite/gas/arm/dis-data.d
diff -N gas/testsuite/gas/arm/dis-data.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/dis-data.d 6 Jan 2010 00:49:36 -0000
@@ -0,0 +1,10 @@
+# name: Data disassembler test
+# skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+# objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section \.text:
+0x00000000 20010000 .word 0x20010000
+0x00000004 000000f9 .word 0x000000f9
+0x00000008 00004cd5 .word 0x00004cd5
Index: gas/testsuite/gas/arm/dis-data.s
===================================================================
RCS file: gas/testsuite/gas/arm/dis-data.s
diff -N gas/testsuite/gas/arm/dis-data.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/dis-data.s 6 Jan 2010 00:49:36 -0000
@@ -0,0 +1,5 @@
+.syntax unified
+.word 0x20010000
+.word 0x000000f9
+.word 0x00004cd5
+
Index: opcodes/arm-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arm-dis.c,v
retrieving revision 1.120
diff -u -p -r1.120 arm-dis.c
--- opcodes/arm-dis.c 4 Jan 2010 10:18:32 -0000 1.120
+++ opcodes/arm-dis.c 6 Jan 2010 00:49:44 -0000
@@ -4355,7 +4355,8 @@ print_insn (bfd_vma pc, struct disassemb
long given;
int status;
int is_thumb = FALSE;
- int is_data = FALSE;
+ int is_data = (bfd_asymbol_flavour (*info->symtab)
+ == bfd_target_elf_flavour) ? TRUE : FALSE;
int little_code;
unsigned int size = 4;
void (*printer) (bfd_vma, struct disassemble_info *, long);
@@ -4415,7 +4416,7 @@ print_insn (bfd_vma pc, struct disassemb
bfd_vma addr;
int n;
int last_sym = -1;
- enum map_type type = MAP_ARM;
+ enum map_type type = MAP_DATA;
if (pc <= last_mapping_addr)
last_mapping_sym = -1;
@@ -4478,7 +4479,9 @@ print_insn (bfd_vma pc, struct disassemb
for (n = last_sym + 1; n < info->symtab_size; n++)
{
addr = bfd_asymbol_value (info->symtab[n]);
- if (addr > pc)
+ if (addr > pc
+ && (info->section == NULL
+ || info->section == info->symtab[n]->section))
{
if (addr - pc < size)
size = addr - pc;