]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* corefile.c (core_init): Call bfd_get_synthetic_symtab.
authorAlan Modra <amodra@gmail.com>
Thu, 14 Apr 2005 11:10:34 +0000 (11:10 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 14 Apr 2005 11:10:34 +0000 (11:10 +0000)
gprof/ChangeLog
gprof/corefile.c

index a38f4d3474133708a157552b86f409a74f5a5ed3..d5805cbc3a644f59bdf89770e9bf394d9f3733d4 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * corefile.c (core_init): Call bfd_get_synthetic_symtab.
+
 2005-03-29  Nick Clifton  <nickc@redhat.com>
 
        * po/de.po: Updated German translation.
index bd594f5a23b6d6a88f011095ec43d5057b37c297..c06f7d4c757ec74e66aee984e2fc1d5d1cb7ef49 100644 (file)
@@ -1,6 +1,6 @@
 /* corefile.c
 
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -142,6 +142,9 @@ void
 core_init (const char *aout_name)
 {
   int core_sym_bytes;
+  asymbol *synthsyms;
+  long synth_count;
+
   core_bfd = bfd_openr (aout_name, 0);
 
   if (!core_bfd)
@@ -190,6 +193,23 @@ core_init (const char *aout_name)
       done (1);
     }
 
+  synth_count = bfd_get_synthetic_symtab (core_bfd, core_num_syms, core_syms,
+                                         0, NULL, &synthsyms);
+  if (synth_count > 0)
+    {
+      asymbol **symp;
+      long new_size;
+      long i;
+
+      new_size = (core_num_syms + synth_count + 1) * sizeof (*core_syms);
+      core_syms = xrealloc (core_syms, new_size);
+      symp = core_syms + core_num_syms;
+      core_num_syms += synth_count;
+      for (i = 0; i < synth_count; i++)
+       *symp++ = synthsyms + i;
+      *symp = 0;
+    }
+
   min_insn_size = 1;
   offset_to_code = 0;