This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
objdump disassemby
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Wed, 19 Nov 2003 18:50:07 +1030
- Subject: objdump disassemby
Nick's recent change to objdump.c:disassemble_section broke numerous
tests. At first, I thought the changed symbols were an intentional
improvement, but changed my mind after looking at more than just the
powerpc resuls. I'm fairly sure that changing the symbol lookup so that
insn operands must use a symbol from the section being disassembled was
an accidental change. ;) This restores the previous behaviour.
* objdump.c: Wrap long lines, init vars separately from decl.
(disassemble_section): Reset require_sec after call to
find_symbol_for_address.
I'm also committing some formatting fixes, which I stripped from the
following diff. If anyone wants to see them, they can get them with
cvs diff -r1.83 -r1.84 binutils/objdump.c
Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.83
diff -u -p -r1.83 objdump.c
--- binutils/objdump.c 14 Nov 2003 15:12:42 -0000 1.83
+++ binutils/objdump.c 19 Nov 2003 07:58:49 -0000
@@ -1628,7 +1640,6 @@ disassemble_section (bfd *abfd, asection
bfd_get_section_contents (abfd, section, data, 0, datasize);
paux->sec = section;
- paux->require_sec = TRUE;
pinfo->buffer = data;
pinfo->buffer_vma = section->vma;
pinfo->buffer_length = datasize;
@@ -1661,7 +1672,9 @@ disassemble_section (bfd *abfd, asection
printf (_("Disassembly of section %s:\n"), section->name);
/* Find the nearest symbol forwards from our current position. */
+ paux->require_sec = TRUE;
sym = find_symbol_for_address (section->vma + addr_offset, info, &place);
+ paux->require_sec = FALSE;
/* Disassemble a block of instructions up to the address associated with
the symbol we have just found. Then print the symbol and find the
--
Alan Modra
IBM OzLabs - Linux Technology Centre