/* corefile.c
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
This file is part of GNU Binutils.
}
/* dummy has the filename, go ahead and copy it. */
- symbol_map[count].file_name = xmalloc (strlen (dummy) + 1);
+ symbol_map[count].file_name = (char *) xmalloc (strlen (dummy) + 1);
strcpy (symbol_map[count].file_name, dummy);
/* Now we need the function name. */
if (!matches)
parse_error (filename);
tmp = strrchr (dummy, ' ') + 1;
- symbol_map[count].function_name = xmalloc (strlen (tmp) + 1);
+ symbol_map[count].function_name = (char *) xmalloc (strlen (tmp) + 1);
strcpy (symbol_map[count].function_name, tmp);
count++;
}
long i;
new_size = (core_num_syms + synth_count + 1) * sizeof (*core_syms);
- core_syms = xrealloc (core_syms, new_size);
+ core_syms = (asymbol **) xrealloc (core_syms, new_size);
symp = core_syms + core_num_syms;
core_num_syms += synth_count;
for (i = 0; i < synth_count; i++)
if (*name == '$')
return 0;
- /* Do not discard nested subprograms (those
- which end with .NNN, where N are digits). */
if (*name == '.')
- for (name++; *name; name++)
- if (! ISDIGIT (*name))
- return 0;
+ {
+ /* Allow GCC cloned functions. */
+ if (strlen (name) > 7 && strncmp (name, ".clone.", 7) == 0)
+ name += 6;
+
+ /* Do not discard nested subprograms (those
+ which end with .NNN, where N are digits). */
+ for (name++; *name; name++)
+ if (! ISDIGIT (*name))
+ return 0;
+
+ break;
+ }
}
/* On systems where the C compiler adds an underscore to all
done (1);
}
- while (!feof (f) && fgets (buf, sizeof (buf), f))
+ while (!feof (f) && fgets (buf, BUFSIZE - 1, f))
{
if (sscanf (buf, "%s %c %s", address, &type, name) == 3)
if (type != 't' && type != 'T')
{
bfd_vma min_vma = ~ (bfd_vma) 0;
bfd_vma max_vma = 0;
- int class;
+ int cxxclass;
long i;
struct function_map * found;
/* Don't create a symtab entry for a function that has
a mapping to a file, unless it's the first function
in the file. */
- found = bsearch (core_syms[i]->name, symbol_map, symbol_map_count,
- sizeof (struct function_map), search_mapped_symbol);
+ found = (struct function_map *) bsearch (core_syms[i]->name, symbol_map,
+ symbol_map_count,
+ sizeof (struct function_map),
+ search_mapped_symbol);
if (found == NULL || found->is_first)
++symtab.len;
}
{
asection *sym_sec;
- class = core_sym_class (core_syms[i]);
+ cxxclass = core_sym_class (core_syms[i]);
- if (!class)
+ if (!cxxclass)
{
DBG (AOUTDEBUG,
printf ("[core_create_function_syms] rejecting: 0x%lx %s\n",
continue;
}
- found = bsearch (core_syms[i]->name, symbol_map, symbol_map_count,
+ found = (struct function_map *) bsearch (core_syms[i]->name, symbol_map,
+ symbol_map_count,
sizeof (struct function_map), search_mapped_symbol);
if (found && ! found->is_first)
continue;
symtab.limit->is_func = (core_syms[i]->flags & BSF_FUNCTION) != 0;
symtab.limit->is_bb_head = TRUE;
- if (class == 't')
+ if (cxxclass == 't')
symtab.limit->is_static = TRUE;
/* Keep track of the minimum and maximum vma addresses used by all
BFD would provide an iterator for enumerating all line infos. */
prev_name_len = PATH_MAX;
prev_filename_len = PATH_MAX;
- prev_name = xmalloc (prev_name_len);
- prev_filename = xmalloc (prev_filename_len);
+ prev_name = (char *) xmalloc (prev_name_len);
+ prev_filename = (char *) xmalloc (prev_filename_len);
ltab.len = 0;
prev_line_num = 0;
{
prev_name_len = len + 1024;
free (prev_name);
- prev_name = xmalloc (prev_name_len);
+ prev_name = (char *) xmalloc (prev_name_len);
}
strcpy (prev_name, dummy.name);
{
prev_filename_len = len + 1024;
free (prev_filename);
- prev_filename = xmalloc (prev_filename_len);
+ prev_filename = (char *) xmalloc (prev_filename_len);
}
strcpy (prev_filename, filename);