/* 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
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
Written by Cygnus Support.
name = NULL;
- /* Handle long section names as in PE. */
- if (bfd_coff_long_section_names (abfd)
+ /* Handle long section names as in PE. On reading, we want to
+ accept long names if the format permits them at all, regardless
+ of the current state of the flag that dictates if we would generate
+ them in outputs; this construct checks if that is the case by
+ attempting to set the flag, without changing its state; the call
+ will fail for formats that do not support long names at all. */
+ if (bfd_coff_set_long_section_names (abfd, bfd_coff_long_section_names (abfd))
&& hdr->s_name[0] == '/')
{
char buf[SCNNMLEN];
char *p;
const char *strings;
+ /* Flag that this BFD uses long names, even though the format might
+ expect them to be off by default. This won't directly affect the
+ format of any output BFD created from this one, but the information
+ can be used to decide what to do. */
+ bfd_coff_set_long_section_names (abfd, TRUE);
memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1);
buf[SCNNMLEN - 1] = '\0';
strindex = strtol (buf, &p, 10);
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++)
}
/* Otherwise fall through. */
case C_EXT:
+ case C_AIX_WEAKEXT:
if (ISFCN (combined->u.syment.n_type))
{
long next, llnos;
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++;
}
}