/* Support for the generic parts of COFF, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Written by Cygnus Support.
coff_make_empty_symbol (bfd *abfd)
{
bfd_size_type amt = sizeof (coff_symbol_type);
- coff_symbol_type *new = bfd_zalloc (abfd, amt);
+ coff_symbol_type *new_symbol = (coff_symbol_type *) bfd_zalloc (abfd, amt);
- if (new == NULL)
+ if (new_symbol == NULL)
return NULL;
- new->symbol.section = 0;
- new->native = 0;
- new->lineno = NULL;
- new->done_lineno = FALSE;
- new->symbol.the_bfd = abfd;
+ new_symbol->symbol.section = 0;
+ new_symbol->native = 0;
+ new_symbol->lineno = NULL;
+ new_symbol->done_lineno = FALSE;
+ new_symbol->symbol.the_bfd = abfd;
- return & new->symbol;
+ return & new_symbol->symbol;
}
/* Make a debugging symbol. */
unsigned long sz ATTRIBUTE_UNUSED)
{
bfd_size_type amt = sizeof (coff_symbol_type);
- coff_symbol_type *new = bfd_alloc (abfd, amt);
+ coff_symbol_type *new_symbol = (coff_symbol_type *) bfd_alloc (abfd, amt);
- if (new == NULL)
+ if (new_symbol == NULL)
return NULL;
/* @@ The 10 is a guess at a plausible maximum number of aux entries
(but shouldn't be a constant). */
amt = sizeof (combined_entry_type) * 10;
- new->native = bfd_zalloc (abfd, amt);
- if (!new->native)
+ new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt);
+ if (!new_symbol->native)
return NULL;
- new->symbol.section = bfd_abs_section_ptr;
- new->symbol.flags = BSF_DEBUGGING;
- new->lineno = NULL;
- new->done_lineno = FALSE;
- new->symbol.the_bfd = abfd;
+ new_symbol->symbol.section = bfd_abs_section_ptr;
+ new_symbol->symbol.flags = BSF_DEBUGGING;
+ new_symbol->lineno = NULL;
+ new_symbol->done_lineno = FALSE;
+ new_symbol->symbol.the_bfd = abfd;
- return & new->symbol;
+ return & new_symbol->symbol;
}
void
combined->u.syment.n_type,
combined->u.syment.n_sclass,
combined->u.syment.n_numaux);
-#ifdef BFD64
- /* fprintf_vma() on a 64-bit enabled host will always print a 64-bit
- value, but really we want to display the address in the target's
- address size. Since we do not have a field in the bfd structure
- to tell us this, we take a guess, based on the target's name. */
- if (strstr (bfd_get_target (abfd), "64") == NULL)
- fprintf (file, "%08lx", (unsigned long) (val & 0xffffffff));
- else
-#endif
- fprintf_vma (file, val);
+ bfd_fprintf_vma (abfd, file, val);
fprintf (file, " %s", symbol->name);
for (aux = 0; aux < combined->u.syment.n_numaux; aux++)
while (l->line_number)
{
fprintf (file, "\n%4d : ", l->line_number);
- fprintf_vma (file, l->u.offset + symbol->section->vma);
+ bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma);
l++;
}
}