[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/24511] New: nm should not mark symbols in .init_array as "
From: |
maskray at google dot com |
Subject: |
[Bug binutils/24511] New: nm should not mark symbols in .init_array as "t" |
Date: |
Fri, 03 May 2019 01:13:20 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24511
Bug ID: 24511
Summary: nm should not mark symbols in .init_array as "t"
Product: binutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: maskray at google dot com
Target Milestone: ---
// bfd/syms.c
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 */
{".edata", 'e'}, /* MSVC's .edata (export) section */
{".fini", 't'}, /* ELF fini section */
{".idata", 'i'}, /* MSVC's .idata (import) section */
{".init", 't'}, /* ELF init 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}
};
/* Return the single-character symbol type corresponding to
section S, or '?' for an unknown COFF section.
Check for any leading string which matches, so .text5 returns
't' as well as .text */
static char
coff_section_type (const char *s)
{
const struct section_to_type *t;
for (t = &stt[0]; t->section; t++)
if (!strncmp (s, t->section, strlen (t->section))) ///////// symbols in
".init_array" are incorrectly marked as 't'
return t->type;
return '?';
}
The behavior is not consistent with a symbol defined in .preinit_array, e.g.
d __preinit_array_start
t __init_array_start
A better choice is probably to mark both as 'd'.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/24511] New: nm should not mark symbols in .init_array as "t",
maskray at google dot com <=