.idata symbols should be reported with i or I flag by nm
PR 24511 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries. (coff_section_type): Adjust comment. (decode_section_type): Likewise. Call coff_section_type before decode_section_type. (bfd_decode_symclass): Use 'c' for common sections other than the standard one.
This commit is contained in:
parent
3104d9ee22
commit
49d9fd42ac
2 changed files with 21 additions and 22 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2020-02-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 24511
|
||||||
|
* syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
|
||||||
|
(coff_section_type): Adjust comment.
|
||||||
|
(decode_section_type): Likewise. Call coff_section_type before
|
||||||
|
decode_section_type.
|
||||||
|
(bfd_decode_symclass): Use 'c' for common sections other than
|
||||||
|
the standard one.
|
||||||
|
|
||||||
2020-02-27 Alan Modra <amodra@gmail.com>
|
2020-02-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
|
* coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
|
||||||
|
|
31
bfd/syms.c
31
bfd/syms.c
|
@ -565,30 +565,15 @@ struct section_to_type
|
||||||
char type;
|
char type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Map section names to POSIX/BSD single-character symbol types.
|
/* Map special section names to POSIX/BSD single-character symbol types.
|
||||||
This table is probably incomplete. It is sorted for convenience of
|
This table is probably incomplete. It is sorted for convenience of
|
||||||
adding entries. Since it is so short, a linear search is used. */
|
adding entries. Since it is so short, a linear search is used. */
|
||||||
static const struct section_to_type stt[] =
|
static const struct section_to_type stt[] =
|
||||||
{
|
{
|
||||||
{".bss", 'b'},
|
|
||||||
{"code", 't'}, /* MRI .text */
|
|
||||||
{".data", 'd'},
|
|
||||||
{"*DEBUG*", 'N'},
|
|
||||||
{".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */
|
|
||||||
{".drectve", 'i'}, /* MSVC's .drective section */
|
{".drectve", 'i'}, /* MSVC's .drective section */
|
||||||
{".edata", 'e'}, /* MSVC's .edata (export) section */
|
{".edata", 'e'}, /* MSVC's .edata (export) section */
|
||||||
{".fini", 't'}, /* ELF fini section */
|
|
||||||
{".idata", 'i'}, /* MSVC's .idata (import) section */
|
{".idata", 'i'}, /* MSVC's .idata (import) section */
|
||||||
{".init", 't'}, /* ELF init section */
|
|
||||||
{".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
|
{".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
|
||||||
{".rdata", 'r'}, /* Read only data. */
|
|
||||||
{".rodata", 'r'}, /* Read only data. */
|
|
||||||
{".sbss", 's'}, /* Small BSS (uninitialized data). */
|
|
||||||
{".scommon", 'c'}, /* Small common. */
|
|
||||||
{".sdata", 'g'}, /* Small initialized data. */
|
|
||||||
{".text", 't'},
|
|
||||||
{"vars", 'd'}, /* MRI .data */
|
|
||||||
{"zerovars", 'b'}, /* MRI .bss */
|
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -596,8 +581,7 @@ static const struct section_to_type stt[] =
|
||||||
section S, or '?' for an unknown COFF section.
|
section S, or '?' for an unknown COFF section.
|
||||||
|
|
||||||
Check for leading strings which match, followed by a number, '.',
|
Check for leading strings which match, followed by a number, '.',
|
||||||
or '$' so .text5 matches the .text entry, but .init_array doesn't
|
or '$' so .idata5 matches the .idata entry. */
|
||||||
match the .init entry. */
|
|
||||||
|
|
||||||
static char
|
static char
|
||||||
coff_section_type (const char *s)
|
coff_section_type (const char *s)
|
||||||
|
@ -619,7 +603,7 @@ coff_section_type (const char *s)
|
||||||
SECTION, or '?' for an unknown section. This uses section flags to
|
SECTION, or '?' for an unknown section. This uses section flags to
|
||||||
identify sections.
|
identify sections.
|
||||||
|
|
||||||
FIXME These types are unhandled: c, i, e, p. If we handled these also,
|
FIXME These types are unhandled: e, i, p. If we handled these also,
|
||||||
we could perhaps obsolete coff_section_type. */
|
we could perhaps obsolete coff_section_type. */
|
||||||
|
|
||||||
static char
|
static char
|
||||||
|
@ -668,7 +652,12 @@ bfd_decode_symclass (asymbol *symbol)
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (symbol->section && bfd_is_com_section (symbol->section))
|
if (symbol->section && bfd_is_com_section (symbol->section))
|
||||||
|
{
|
||||||
|
if (symbol->section == bfd_com_section_ptr)
|
||||||
return 'C';
|
return 'C';
|
||||||
|
else
|
||||||
|
return 'c';
|
||||||
|
}
|
||||||
if (bfd_is_und_section (symbol->section))
|
if (bfd_is_und_section (symbol->section))
|
||||||
{
|
{
|
||||||
if (symbol->flags & BSF_WEAK)
|
if (symbol->flags & BSF_WEAK)
|
||||||
|
@ -705,9 +694,9 @@ bfd_decode_symclass (asymbol *symbol)
|
||||||
c = 'a';
|
c = 'a';
|
||||||
else if (symbol->section)
|
else if (symbol->section)
|
||||||
{
|
{
|
||||||
c = decode_section_type (symbol->section);
|
|
||||||
if (c == '?')
|
|
||||||
c = coff_section_type (symbol->section->name);
|
c = coff_section_type (symbol->section->name);
|
||||||
|
if (c == '?')
|
||||||
|
c = decode_section_type (symbol->section);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return '?';
|
return '?';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue