From: Alan Modra Date: Thu, 1 Oct 2009 06:33:15 +0000 (+0000) Subject: * addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols. X-Git-Tag: sid-snapshot-20091001~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5e7ea07f51c7a016915f6ea261808bf3fbd430b;p=external%2Fbinutils.git * addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index d316adc..331bc16 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2009-10-01 Alan Modra + + * addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols. + 2009-09-29 Nick Clifton * doc/binutils.texi (c++filt): Remove spurious description of @@ -88,8 +92,7 @@ 2009-09-10 Martin Thuresson - Update soruces to compile cleanly with -Wc++-compat: - + Update sources to compile cleanly with -Wc++-compat: * addr2line.c (slurp_symtab): Fix casts. Introduce variable minisyms to avoid aliasing varning. * ar.c: Add casts. diff --git a/binutils/addr2line.c b/binutils/addr2line.c index 5425664..1872521 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -100,17 +100,27 @@ usage (FILE *stream, int status) static void slurp_symtab (bfd *abfd) { + long storage; long symcount; - unsigned int size; - void *minisyms = &syms; + bfd_boolean dynamic = FALSE; if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0) return; - symcount = bfd_read_minisymbols (abfd, FALSE, &minisyms, &size); - if (symcount == 0) - symcount = bfd_read_minisymbols (abfd, TRUE /* dynamic */, &minisyms, &size); + storage = bfd_get_symtab_upper_bound (abfd); + if (storage == 0) + { + storage = bfd_get_dynamic_symtab_upper_bound (abfd); + dynamic = TRUE; + } + if (storage < 0) + bfd_fatal (bfd_get_filename (abfd)); + syms = (asymbol **) xmalloc (storage); + if (dynamic) + symcount = bfd_canonicalize_dynamic_symtab (abfd, syms); + else + symcount = bfd_canonicalize_symtab (abfd, syms); if (symcount < 0) bfd_fatal (bfd_get_filename (abfd)); }