* addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols.
This commit is contained in:
parent
966d409744
commit
d5e7ea07f5
2 changed files with 20 additions and 7 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2009-10-01 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols.
|
||||||
|
|
||||||
2009-09-29 Nick Clifton <nickc@redhat.com>
|
2009-09-29 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* doc/binutils.texi (c++filt): Remove spurious description of
|
* doc/binutils.texi (c++filt): Remove spurious description of
|
||||||
|
@ -88,8 +92,7 @@
|
||||||
|
|
||||||
2009-09-10 Martin Thuresson <martin@mtme.org>
|
2009-09-10 Martin Thuresson <martin@mtme.org>
|
||||||
|
|
||||||
Update soruces to compile cleanly with -Wc++-compat:
|
Update sources to compile cleanly with -Wc++-compat:
|
||||||
|
|
||||||
* addr2line.c (slurp_symtab): Fix casts. Introduce variable
|
* addr2line.c (slurp_symtab): Fix casts. Introduce variable
|
||||||
minisyms to avoid aliasing varning.
|
minisyms to avoid aliasing varning.
|
||||||
* ar.c: Add casts.
|
* ar.c: Add casts.
|
||||||
|
|
|
@ -100,17 +100,27 @@ usage (FILE *stream, int status)
|
||||||
static void
|
static void
|
||||||
slurp_symtab (bfd *abfd)
|
slurp_symtab (bfd *abfd)
|
||||||
{
|
{
|
||||||
|
long storage;
|
||||||
long symcount;
|
long symcount;
|
||||||
unsigned int size;
|
bfd_boolean dynamic = FALSE;
|
||||||
void *minisyms = &syms;
|
|
||||||
|
|
||||||
if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0)
|
if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
symcount = bfd_read_minisymbols (abfd, FALSE, &minisyms, &size);
|
storage = bfd_get_symtab_upper_bound (abfd);
|
||||||
if (symcount == 0)
|
if (storage == 0)
|
||||||
symcount = bfd_read_minisymbols (abfd, TRUE /* dynamic */, &minisyms, &size);
|
{
|
||||||
|
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)
|
if (symcount < 0)
|
||||||
bfd_fatal (bfd_get_filename (abfd));
|
bfd_fatal (bfd_get_filename (abfd));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue