| 1 |
/* Support for the generic parts of COFF, for BFD. |
/* Support for the generic parts of COFF, for BFD. |
| 2 |
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 3 |
2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 |
2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 |
| 4 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
| 5 |
Written by Cygnus Support. |
Written by Cygnus Support. |
| 6 |
|
|
| 59 |
|
|
| 60 |
name = NULL; |
name = NULL; |
| 61 |
|
|
| 62 |
/* Handle long section names as in PE. */ |
/* Handle long section names as in PE. On reading, we want to |
| 63 |
if (bfd_coff_long_section_names (abfd) |
accept long names if the format permits them at all, regardless |
| 64 |
|
of the current state of the flag that dictates if we would generate |
| 65 |
|
them in outputs; this construct checks if that is the case by |
| 66 |
|
attempting to set the flag, without changing its state; the call |
| 67 |
|
will fail for formats that do not support long names at all. */ |
| 68 |
|
if (bfd_coff_set_long_section_names (abfd, bfd_coff_long_section_names (abfd)) |
| 69 |
&& hdr->s_name[0] == '/') |
&& hdr->s_name[0] == '/') |
| 70 |
{ |
{ |
| 71 |
char buf[SCNNMLEN]; |
char buf[SCNNMLEN]; |
| 73 |
char *p; |
char *p; |
| 74 |
const char *strings; |
const char *strings; |
| 75 |
|
|
| 76 |
|
/* Flag that this BFD uses long names, even though the format might |
| 77 |
|
expect them to be off by default. This won't directly affect the |
| 78 |
|
format of any output BFD created from this one, but the information |
| 79 |
|
can be used to decide what to do. */ |
| 80 |
|
bfd_coff_set_long_section_names (abfd, TRUE); |
| 81 |
memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1); |
memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1); |
| 82 |
buf[SCNNMLEN - 1] = '\0'; |
buf[SCNNMLEN - 1] = '\0'; |
| 83 |
strindex = strtol (buf, &p, 10); |
strindex = strtol (buf, &p, 10); |
| 1959 |
combined->u.syment.n_type, |
combined->u.syment.n_type, |
| 1960 |
combined->u.syment.n_sclass, |
combined->u.syment.n_sclass, |
| 1961 |
combined->u.syment.n_numaux); |
combined->u.syment.n_numaux); |
| 1962 |
#ifdef BFD64 |
bfd_fprintf_vma (abfd, file, val); |
|
/* 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); |
|
| 1963 |
fprintf (file, " %s", symbol->name); |
fprintf (file, " %s", symbol->name); |
| 1964 |
|
|
| 1965 |
for (aux = 0; aux < combined->u.syment.n_numaux; aux++) |
for (aux = 0; aux < combined->u.syment.n_numaux; aux++) |
| 2002 |
} |
} |
| 2003 |
/* Otherwise fall through. */ |
/* Otherwise fall through. */ |
| 2004 |
case C_EXT: |
case C_EXT: |
| 2005 |
|
case C_AIX_WEAKEXT: |
| 2006 |
if (ISFCN (combined->u.syment.n_type)) |
if (ISFCN (combined->u.syment.n_type)) |
| 2007 |
{ |
{ |
| 2008 |
long next, llnos; |
long next, llnos; |
| 2042 |
while (l->line_number) |
while (l->line_number) |
| 2043 |
{ |
{ |
| 2044 |
fprintf (file, "\n%4d : ", l->line_number); |
fprintf (file, "\n%4d : ", l->line_number); |
| 2045 |
fprintf_vma (file, l->u.offset + symbol->section->vma); |
bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma); |
| 2046 |
l++; |
l++; |
| 2047 |
} |
} |
| 2048 |
} |
} |