aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-09-16 16:33:18 +0000
committerIan Lance Taylor <ian@airs.com>1994-09-16 16:33:18 +0000
commit2d0546410d0e67caa4b51e755968070389681a44 (patch)
tree99ce5b131cdef6de6ac828138f3e94af0dc8f027 /binutils
parent006ae0e478df91cb8b7fb57c27598f9f12cd7789 (diff)
downloadgdb-2d0546410d0e67caa4b51e755968070389681a44.zip
gdb-2d0546410d0e67caa4b51e755968070389681a44.tar.gz
gdb-2d0546410d0e67caa4b51e755968070389681a44.tar.bz2
* objdump.c (objdump_print_address): If we can't find a smaller
symbol in the right section, look for a larger one.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog3
-rw-r--r--binutils/objdump.c27
2 files changed, 23 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 797acde..634ad89 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -2,7 +2,8 @@ Fri Sep 16 11:27:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
* objdump.c (struct objdump_disasm_info): Add field require_sec.
(objdump_print_address): If aux->require_sec, require that the
- symbol be in aux->sec even if HAS_RELOC is not set.
+ symbol be in aux->sec even if HAS_RELOC is not set. If we can't
+ find a smaller symbol in the right section, look for a larger one.
(disassemble_data): Set aux.require_sec around the
objdump_print_address call for the instruction address.
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 496033f..1b5db95 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -422,12 +422,12 @@ objdump_print_address (vma, info)
long i;
aux = (struct objdump_disasm_info *) info->application_data;
- if ((aux->require_sec
- || (aux->abfd->flags & HAS_RELOC) != 0)
- && vma >= bfd_get_section_vma (aux->abfd, aux->sec)
- && vma < (bfd_get_section_vma (aux->abfd, aux->sec)
- + bfd_get_section_size_before_reloc (aux->sec))
- && syms[thisplace]->section != aux->sec)
+ if (syms[thisplace]->section != aux->sec
+ && (aux->require_sec
+ || ((aux->abfd->flags & HAS_RELOC) != 0
+ && vma >= bfd_get_section_vma (aux->abfd, aux->sec)
+ && vma < (bfd_get_section_vma (aux->abfd, aux->sec)
+ + bfd_get_section_size_before_reloc (aux->sec)))))
{
for (i = thisplace + 1; i < symcount; i++)
{
@@ -443,8 +443,23 @@ objdump_print_address (vma, info)
break;
}
}
+
+ if (syms[thisplace]->section != aux->sec)
+ {
+ /* We didn't find a good symbol with a smaller value.
+ Look for one with a larger value. */
+ for (i = thisplace + 1; i < symcount; i++)
+ {
+ if (syms[i]->section == aux->sec)
+ {
+ thisplace = i;
+ break;
+ }
+ }
+ }
}
}
+
fprintf (info->stream, " <%s", syms[thisplace]->name);
if (syms[thisplace]->value > vma)
{