]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols.
authorAlan Modra <amodra@gmail.com>
Thu, 1 Oct 2009 06:42:38 +0000 (06:42 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 1 Oct 2009 06:42:38 +0000 (06:42 +0000)
binutils/ChangeLog
binutils/addr2line.c

index a973c65781486c510fab9d5a7ab3a673431c6727..bee7b3571768bfe8a8b77accc9ec7af049929fc8 100644 (file)
@@ -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>
 
        * doc/binutils.texi (c++filt): Remove spurious description of
@@ -24,7 +28,7 @@
 
 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
        minisyms to avoid aliasing varning.
        * ar.c: Add casts.
@@ -39,7 +43,7 @@
        debug_baseclass_s, struct debug_method_s, struct
        debug_method_variant_s, struct debug_type_s): Rename struct from
        avoid name collision.
-        * debug.h: Use new struct names.
+       * debug.h: Use new struct names.
        * dwarf.c: Add casts.
        (free_debug_memory): Change loop counter variable a to int.
        * ieee.c: Add casts.
@@ -48,7 +52,7 @@
        (ieee_class_method_var): Rename variable virtual to is_virtual.
        * nm.c: Add casts.
        * objcopy.c: Add casts.
-       (copy_archive): Rename variable delete to del.
+       (copy_archive): Rename variable delete to del.
        * objdump.c: Add casts.
        (dump_dwarf_section): Change loop counter variable i to int.
        * prdbg.c: Add casts.
 
 2009-09-07  Tristan Gingold  <gingold@adacore.com>
 
-       * po/binutils.pot: Regenerate
+       * po/binutils.pot: Regenerate.
 
 2009-09-05  Martin Thuresson  <martin@mtme.org>
 
 
        * dlltool.c (delayimp_name): Add new global variable
        (usage, long_options, main): Add new option "-y" / "--output-delaylib"
-       (struct mac): Add fields how_dljtab_size, how_dljtab_roff1, 
+       (struct mac): Add fields how_dljtab_size, how_dljtab_roff1,
        how_dljtab_roff2, how_dljtab, trampoline.
        (i386_dljtab): Add binary stub for x86 delay import.
        (i386_trampoline): Add text assembly stub for x86 delay import.
 2009-03-27  Nick Clifton  <nickc@redhat.com>
 
        * dwarf.c (display_debug_ranges): Add the base address to the
-       displayed values for 'Begin' and 'End'. 
+       displayed values for 'Begin' and 'End'.
 
 2009-03-25  Ryan Mansfield  <rmansfield@qnx.com>
 
 
        Cleanup code related to --identify option.
 
-       * binutils/dlltool.c (file scope): Removed globals identify_ms,
+       * dlltool.c (file scope): Removed globals identify_ms,
        identify_member_contains_symname_result,
        identify_dll_name_list_head, and identify_dll_name_list_tail.
        Renamed existing typedef dll_name_list_type to
index 1234c05b0eb00c1a97a763994d76adc2f7d82637..187252151ff65dc998888abe14403dbf67029a08 100644 (file)
@@ -1,6 +1,6 @@
 /* addr2line.c -- convert addresses to line number and function name
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 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 <Ulrich.Lauther@mchp.siemens.de>
 
    This file is part of GNU Binutils.
@@ -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));
 }