summaryrefslogtreecommitdiff
path: root/binutils/addr2line.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-03-15 16:24:59 +0000
committerNick Clifton <nickc@redhat.com>2013-03-15 16:24:59 +0000
commit3fad6af728437a1a4c05e64a66698a4591b44d7c (patch)
tree4ff0d7bc79db8e865c3b7c4f84a5d614c769af29 /binutils/addr2line.c
parentfa95897fb3ccde5a900a3f020dc3f0bd7ddfb638 (diff)
downloadbinutils-redhat-3fad6af728437a1a4c05e64a66698a4591b44d7c.tar.gz
* addr2line.c (slurp_symtab): If canonicalization reveals that
there were no ordinary symbols, try loading the dynamic symbols instead.
Diffstat (limited to 'binutils/addr2line.c')
-rw-r--r--binutils/addr2line.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index b4f604b4b9..0de73982f5 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -130,6 +130,17 @@ slurp_symtab (bfd *abfd)
symcount = bfd_canonicalize_symtab (abfd, syms);
if (symcount < 0)
bfd_fatal (bfd_get_filename (abfd));
+
+ /* If there are no symbols left after canonicalization and
+ we have not tried the dynamic symbols then give them a go. */
+ if (symcount == 0
+ && ! dynamic
+ && (storage = bfd_get_dynamic_symtab_upper_bound (abfd)) > 0)
+ {
+ free (syms);
+ syms = xmalloc (storage);
+ symcount = bfd_canonicalize_dynamic_symtab (abfd, syms);
+ }
}
/* These global variables are used to pass information between