X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=binutils%2Faddr2line.c;fp=binutils%2Faddr2line.c;h=187252151ff65dc998888abe14403dbf67029a08;hp=cd31b8191e7627660906d1a286ce9d77b63c6c7d;hb=d5da4f291af551c0b8b79e1d4a9b173d60e5c10e;hpb=7b5ea4fcdf2819e070665ab5610f8b48e3867c10 diff --git a/binutils/addr2line.c b/binutils/addr2line.c index cd31b81..1872521 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -1,6 +1,6 @@ /* addr2line.c -- convert addresses to line number and function name - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 - Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2009 Free Software Foundation, Inc. Contributed by Ulrich Lauther This file is part of GNU Binutils. @@ -100,16 +100,27 @@ usage (FILE *stream, int status) static void slurp_symtab (bfd *abfd) { + long storage; long symcount; - unsigned int size; + bfd_boolean dynamic = FALSE; if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0) return; - symcount = bfd_read_minisymbols (abfd, FALSE, (void *) &syms, &size); - if (symcount == 0) - symcount = bfd_read_minisymbols (abfd, TRUE /* dynamic */, (void *) &syms, &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)); }