This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix objdump -dR
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 22 Dec 2003 09:29:39 +0100
- Subject: [PATCH] Fix objdump -dR
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
The second hunk fixes a bug introduced recently. pinfo->buffer_vma is
initialized after rel_offset, so should not be used in rel_offset setting
(or pinfo->buffer_vma = section->vma; line would need to be moved above it).
This leads to no dynamic relocs printed in objdump -dR.
The first hunk fixes a long standing bug, where objdump prints wrong
addresses, e.g.:
00000288 <foobar>:
288: e8 fc ff ff ff call 289 <foobar+0x1>
50d: R_386_PC32 loser
28d: c3 ret
(289 should be printed, 50d is 284 (.text's VMA) + 289).
Ok to commit?
2003-12-22 Jakub Jelinek <jakub@redhat.com>
* objdump.c (disassemble_bytes): Subtract rel_offset from printed
reloc address.
(disassemble_section): Set rel_offset to section->vma instead of
pinfo->buffer_vma.
--- binutils/objdump.c.jj 2003-12-22 10:49:43.000000000 +0100
+++ binutils/objdump.c 2003-12-22 11:19:09.000000000 +0100
@@ -1515,7 +1515,8 @@ disassemble_bytes (struct disassemble_in
else
printf ("\t\t\t");
- objdump_print_value (section->vma + q->address, info, TRUE);
+ objdump_print_value (section->vma - rel_offset + q->address,
+ info, TRUE);
printf (": %s\t", q->howto->name);
@@ -1600,7 +1601,7 @@ disassemble_section (bfd *abfd, asection
/* Dynamic reloc addresses are absolute, non-dynamic are section
relative. REL_OFFSET specifies the reloc address corresponding
to the start of this section. */
- rel_offset = pinfo->buffer_vma;
+ rel_offset = section->vma;
}
else
{
Jakub