aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-06 18:57:04 +0930
committerAlan Modra <amodra@gmail.com>2021-04-06 23:25:09 +0930
commita2e66773735d2d2de2ba652e44650288c88ad752 (patch)
treef2e8dfe1592fd03641ab6e14951cc89e3e38b79e /binutils
parent4db29512ce5616e90a9cdbc4daa852589b7357c0 (diff)
downloadfsf-binutils-gdb-a2e66773735d2d2de2ba652e44650288c88ad752.zip
fsf-binutils-gdb-a2e66773735d2d2de2ba652e44650288c88ad752.tar.gz
fsf-binutils-gdb-a2e66773735d2d2de2ba652e44650288c88ad752.tar.bz2
Return symbol from symbol_at_address_func
include/ * dis-asm.h (struct disassemble_info <symbol_at_address_func>): Return asymbol*. binutils/ * objdump.c (objdump_symbol_at_address): Return asymbol*. opcodes/ * dis-buf.c (generic_symbol_at_address): Return symbol* NULL. * s12z-dis.c (decode_possible_symbol): Use symbol returned from symbol_at_address_func.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/objdump.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 13fa6d2..413757d 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,9 @@
2021-04-06 Alan Modra <amodra@gmail.com>
+ * objdump.c (objdump_symbol_at_address): Return asymbol*.
+
+2021-04-06 Alan Modra <amodra@gmail.com>
+
* NEWS: Mention C99 requirement.
* README: Likewise. Modernise examples and "Reporting bugs".
diff --git a/binutils/objdump.c b/binutils/objdump.c
index aa1215c..ea80a70 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -1459,14 +1459,16 @@ objdump_print_address (bfd_vma vma, struct disassemble_info *inf)
/* Determine if the given address has a symbol associated with it. */
-static int
+static asymbol *
objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * inf)
{
asymbol * sym;
sym = find_symbol_for_address (vma, inf, NULL);
+ if (sym != NULL && bfd_asymbol_value (sym) == vma)
+ return sym;
- return (sym != NULL && (bfd_asymbol_value (sym) == vma));
+ return NULL;
}
/* Hold the last function name and the last line number we displayed