diff options
author | Alan Modra <amodra@gmail.com> | 2009-10-01 06:33:15 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2009-10-01 06:33:15 +0000 |
commit | d5e7ea07f51c7a016915f6ea261808bf3fbd430b (patch) | |
tree | 5b834494b101aa7cb3bdfc40b4a6b3eb2f66bb2c /binutils/addr2line.c | |
parent | 966d4097440bd7c3e35524bebf39d8bbe2e26fd6 (diff) | |
download | gdb-d5e7ea07f51c7a016915f6ea261808bf3fbd430b.zip gdb-d5e7ea07f51c7a016915f6ea261808bf3fbd430b.tar.gz gdb-d5e7ea07f51c7a016915f6ea261808bf3fbd430b.tar.bz2 |
* addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols.
Diffstat (limited to 'binutils/addr2line.c')
-rw-r--r-- | binutils/addr2line.c | 20 |
1 files changed, 15 insertions, 5 deletions
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)); } |