summaryrefslogtreecommitdiff
path: root/binutils/objdump.c
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/objdump.c
parent4db29512ce5616e90a9cdbc4daa852589b7357c0 (diff)
downloadbinutils-gdb-a2e66773735d2d2de2ba652e44650288c88ad752.tar.gz
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/objdump.c')
-rw-r--r--binutils/objdump.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index aa1215cede8..ea80a704ee3 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