* symfile.h (sym_fns), symfile.c (find_sym_fns), xcoffread.c,

coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c:
	Change from using bfd target name to using the flavour.
This commit is contained in:
Jim Kingdon 1993-10-31 18:54:28 +00:00
parent 47f45d6636
commit 0eed42deee
9 changed files with 27 additions and 45 deletions

View File

@ -1,5 +1,9 @@
Sun Oct 31 09:28:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* symfile.h (sym_fns), symfile.c (find_sym_fns), xcoffread.c,
coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c:
Change from using bfd target name to using the flavour.
* objfiles.h, infcmd.c, symfile.c: Add comments about how various
objfiles get created and when we should blow them away.

View File

@ -2062,8 +2062,7 @@ coff_symfile_offsets (objfile, addr)
static struct sym_fns coff_sym_fns =
{
"coff", /* sym_name: name or name prefix of BFD target type */
4, /* sym_namelen: number of significant sym_name chars */
bfd_target_coff_flavour,
coff_new_init, /* sym_new_init: init anything gbl to entire symtab */
coff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
coff_symfile_read, /* sym_read: read a symbol file into symtab */

View File

@ -2188,36 +2188,9 @@ dbx_symfile_offsets (objfile, addr)
return section_offsets;
}
/* Register our willingness to decode symbols for SunOS and a.out and
NetBSD and b.out files handled by BFD... */
static struct sym_fns sunos_sym_fns =
{
"sunOs", /* sym_name: name or name prefix of BFD target type */
6, /* sym_namelen: number of significant sym_name chars */
dbx_new_init, /* sym_new_init: init anything gbl to entire symtab */
dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
dbx_symfile_read, /* sym_read: read a symbol file into symtab */
dbx_symfile_finish, /* sym_finish: finished with file, cleanup */
dbx_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
NULL /* next: pointer to next struct sym_fns */
};
static struct sym_fns aout_sym_fns =
{
"a.out", /* sym_name: name or name prefix of BFD target type */
5, /* sym_namelen: number of significant sym_name chars */
dbx_new_init, /* sym_new_init: init anything gbl to entire symtab */
dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
dbx_symfile_read, /* sym_read: read a symbol file into symtab */
dbx_symfile_finish, /* sym_finish: finished with file, cleanup */
dbx_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
NULL /* next: pointer to next struct sym_fns */
};
static struct sym_fns bout_sym_fns =
{
"b.out", /* sym_name: name or name prefix of BFD target type */
5, /* sym_namelen: number of significant sym_name chars */
bfd_target_aout_flavour,
dbx_new_init, /* sym_new_init: init anything gbl to entire symtab */
dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
dbx_symfile_read, /* sym_read: read a symbol file into symtab */
@ -2229,7 +2202,5 @@ static struct sym_fns bout_sym_fns =
void
_initialize_dbxread ()
{
add_symtab_fns(&sunos_sym_fns);
add_symtab_fns(&aout_sym_fns);
add_symtab_fns(&bout_sym_fns);
}

View File

@ -699,8 +699,7 @@ elfstab_offset_sections (objfile, pst)
static struct sym_fns elf_sym_fns =
{
"elf", /* sym_name: name or name prefix of BFD target type */
3, /* sym_namelen: number of significant sym_name chars */
bfd_target_elf_flavour,
elf_new_init, /* sym_new_init: init anything gbl to entire symtab */
elf_symfile_init, /* sym_init: read initial info, setup for sym_read() */
elf_symfile_read, /* sym_read: read a symbol file into symtab */

View File

@ -3633,8 +3633,7 @@ mipscoff_symfile_offsets (objfile, addr)
static struct sym_fns ecoff_sym_fns =
{
"ecoff", /* sym_name: name or name prefix of BFD target type */
5, /* sym_namelen: number of significant sym_name chars */
bfd_target_ecoff_flavour,
mipscoff_new_init, /* sym_new_init: init anything gbl to entire symtab */
mipscoff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
mipscoff_symfile_read, /* sym_read: read a symbol file into symtab */

View File

@ -286,8 +286,7 @@ nlm_symfile_offsets (objfile, addr)
static struct sym_fns nlm_sym_fns =
{
"nlm", /* sym_name: name or name prefix of BFD target type */
3, /* sym_namelen: number of significant sym_name chars */
bfd_target_nlm_flavour,
nlm_new_init, /* sym_new_init: init anything gbl to entire symtab */
nlm_symfile_init, /* sym_init: read initial info, setup for sym_read() */
nlm_symfile_read, /* sym_read: read a symbol file into symtab */

View File

@ -504,8 +504,7 @@ pa_symfile_offsets (objfile, addr)
static struct sym_fns pa_sym_fns =
{
"som", /* sym_name: name or name prefix of BFD target type */
3, /* sym_namelen: number of significant sym_name chars */
bfd_target_som_flavour
pa_new_init, /* sym_new_init: init anything gbl to entire symtab */
pa_symfile_init, /* sym_init: read initial info, setup for sym_read() */
pa_symfile_read, /* sym_read: read a symbol file into symtab */

View File

@ -796,11 +796,15 @@ find_sym_fns (objfile)
struct objfile *objfile;
{
struct sym_fns *sf;
enum bfd_flavour our_flavour = bfd_get_flavour (objfile -> obfd);
/* Special kludge for RS/6000. See xcoffread.c. */
if (STREQ (bfd_get_target (objfile -> obfd), "aixcoff-rs6000"))
our_flavour = (enum bfd_flavour)-1;
for (sf = symtab_fns; sf != NULL; sf = sf -> next)
{
if (strncmp (bfd_get_target (objfile -> obfd),
sf -> sym_name, sf -> sym_namelen) == 0)
if (our_flavour == sf -> sym_flavour)
{
objfile -> sf = sf;
return;

View File

@ -2140,12 +2140,20 @@ xcoff_symfile_offsets (objfile, addr)
return section_offsets;
}
/* Register our ability to parse symbols for xcoff BFD files. */
/* Register our ability to parse symbols for xcoff BFD files. */
static struct sym_fns xcoff_sym_fns =
{
"aixcoff-rs6000", /* sym_name: name or name prefix of BFD target type */
15, /* sym_namelen: number of significant sym_name chars */
/* Because the bfd uses coff_flavour, we need to specially kludge
the flavour. FIXME: coff and xcoff and fundamentally similar
except for debug format, and we should see if we can merge this
file with coffread.c. For example, the extra storage classes
used for stabs could presumably be recognized in any COFF file. */
(bfd_flavour)-1,
xcoff_new_init, /* sym_new_init: init anything gbl to entire symtab */
xcoff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
xcoff_symfile_read, /* sym_read: read a symbol file into symtab */