Clean up backend format names

The backend format names were rather redundant and not always
helpful. Do some cleanup.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2019-08-10 02:28:17 -07:00
parent 355bfb879d
commit 9084beb1bb
11 changed files with 30 additions and 43 deletions

View File

@ -974,7 +974,6 @@ struct ofmt {
*/
struct ofmt_alias {
const char *shortname;
const char *fullname;
const struct ofmt *ofmt;
};

View File

@ -78,7 +78,7 @@ void null_debug_cleanup(void)
}
const struct dfmt null_debug_form = {
"Null debug format",
"Null",
"null",
null_debug_init,
null_debug_linenum,

View File

@ -871,7 +871,7 @@ extern macros_t aout_stdmac[];
#ifdef OF_AOUT
const struct ofmt of_aout = {
"Linux a.out object files",
"Linux a.out",
"aout",
".o",
0,
@ -898,7 +898,7 @@ const struct ofmt of_aout = {
#ifdef OF_AOUTB
const struct ofmt of_aoutb = {
"NetBSD/FreeBSD a.out object files",
"NetBSD/FreeBSD a.out",
"aoutb",
".o",
0,

View File

@ -586,7 +586,7 @@ static void as86_sect_write(struct Section *sect,
extern macros_t as86_stdmac[];
const struct ofmt of_as86 = {
"Linux as86 (bin86 version 0.3) object files",
"as86 (bin86/dev86 toolchain)",
"as86",
".o",
0,

View File

@ -1596,7 +1596,7 @@ static void do_output_srec(void)
const struct ofmt of_bin = {
"flat-form binary files (e.g. DOS .COM, .SYS)",
"Flat raw binary (MS-DOS, embedded, ...)",
"bin",
"",
0,
@ -1619,7 +1619,7 @@ const struct ofmt of_bin = {
};
const struct ofmt of_ith = {
"Intel hex",
"Intel Hex encoded flat binary",
"ith",
".ith", /* really should have been ".hex"... */
OFMT_TEXT,
@ -1642,7 +1642,7 @@ const struct ofmt of_ith = {
};
const struct ofmt of_srec = {
"Motorola S-records",
"Motorola S-records encoded flat binary",
"srec",
".srec",
OFMT_TEXT,

View File

@ -1134,7 +1134,7 @@ extern macros_t coff_stdmac[];
#ifdef OF_COFF
const struct ofmt of_coff = {
"COFF (i386) object files (e.g. DJGPP for DOS)",
"COFF (i386) (DJGPP, some Unix variants)",
"coff",
".o",
0,
@ -1165,7 +1165,7 @@ extern const struct dfmt df_cv8;
static const struct dfmt * const win32_debug_arr[2] = { &df_cv8, NULL };
const struct ofmt of_win32 = {
"Microsoft Win32 (i386) object files",
"Microsoft extended COFF for Win32 (i386)",
"win32",
".obj",
0,
@ -1194,7 +1194,7 @@ const struct ofmt of_win32 = {
static const struct dfmt * const win64_debug_arr[2] = { &df_cv8, NULL };
const struct ofmt of_win64 = {
"Microsoft Win64 (x86-64) object files",
"Microsoft extended COFF for Win64 (x86-64)",
"win64",
".obj",
0,

View File

@ -2357,7 +2357,7 @@ static const struct pragma_facility elf_pragma_list[] =
static const struct dfmt elf32_df_dwarf = {
"ELF32 (i386) dwarf debug format for Linux/Unix",
"ELF32 (i386) dwarf (newer)",
"dwarf",
dwarf_init,
dwarf_linenum,
@ -2370,7 +2370,7 @@ static const struct dfmt elf32_df_dwarf = {
};
static const struct dfmt elf32_df_stabs = {
"ELF32 (i386) stabs debug format for Linux/Unix",
"ELF32 (i386) stabs (older)",
"stabs",
null_debug_init,
stabs_linenum,
@ -2386,7 +2386,7 @@ static const struct dfmt * const elf32_debugs_arr[3] =
{ &elf32_df_dwarf, &elf32_df_stabs, NULL };
const struct ofmt of_elf32 = {
"ELF32 (i386) object files (e.g. Linux)",
"ELF32 (i386) (Linux, most Unix variants)",
"elf32",
".o",
0,
@ -2409,7 +2409,7 @@ const struct ofmt of_elf32 = {
};
static const struct dfmt elf64_df_dwarf = {
"ELF64 (x86-64) dwarf debug format for Linux/Unix",
"ELF64 (x86-64) dwarf (newer)",
"dwarf",
dwarf_init,
dwarf_linenum,
@ -2422,7 +2422,7 @@ static const struct dfmt elf64_df_dwarf = {
};
static const struct dfmt elf64_df_stabs = {
"ELF64 (x86-64) stabs debug format for Linux/Unix",
"ELF64 (x86-64) stabs (older)",
"stabs",
null_debug_init,
stabs_linenum,
@ -2438,7 +2438,7 @@ static const struct dfmt * const elf64_debugs_arr[3] =
{ &elf64_df_dwarf, &elf64_df_stabs, NULL };
const struct ofmt of_elf64 = {
"ELF64 (x86_64) object files (e.g. Linux)",
"ELF64 (x86-64) (Linux, most Unix variants)",
"elf64",
".o",
0,
@ -2461,7 +2461,7 @@ const struct ofmt of_elf64 = {
};
static const struct dfmt elfx32_df_dwarf = {
"ELFX32 (x86-64) dwarf debug format for Linux/Unix",
"ELFx32 (x86-64) dwarf (newer)",
"dwarf",
dwarf_init,
dwarf_linenum,
@ -2474,7 +2474,7 @@ static const struct dfmt elfx32_df_dwarf = {
};
static const struct dfmt elfx32_df_stabs = {
"ELFX32 (x86-64) stabs debug format for Linux/Unix",
"ELFx32 (x86-64) stabs (older)",
"stabs",
null_debug_init,
stabs_linenum,
@ -2490,7 +2490,7 @@ static const struct dfmt * const elfx32_debugs_arr[3] =
{ &elfx32_df_dwarf, &elfx32_df_stabs, NULL };
const struct ofmt of_elfx32 = {
"ELFX32 (x86_64) object files (e.g. Linux)",
"ELFx32 (ELF32 for x86-64) (Linux)",
"elfx32",
".o",
0,

View File

@ -101,9 +101,9 @@ void ofmt_list(const struct ofmt *deffmt, FILE * fp)
for (i = 0; i < ARRAY_SIZE(ofmt_aliases); i++) {
if (!ofmt_aliases[i].shortname)
continue;
fprintf(fp, " %-20s %s\n",
fprintf(fp, " %-20s Legacy alias for \"%s\"\n",
ofmt_aliases[i].shortname,
ofmt_aliases[i].fullname);
ofmt_aliases[i].ofmt->shortname);
}
}

View File

@ -345,27 +345,15 @@ static const struct ofmt * const drivers[] = {
static const struct ofmt_alias ofmt_aliases[] = {
#ifdef OF_ELF32
{
"elf",
"ELF (short name for ELF32)",
&of_elf32,
},
{ "elf", &of_elf32 },
#endif
#ifdef OF_MACHO32
{
"macho",
"MACHO (short name for MACHO32)",
&of_macho32,
},
{ "macho", &of_macho32 },
#endif
#ifdef OF_WIN32
{
"win",
"WIN (short name for WIN32)",
&of_win32,
},
{ "win", &of_win32 },
#endif
{ NULL, NULL, NULL }
{ NULL, NULL }
};
#endif /* BUILD_DRIVERS_ARRAY */

View File

@ -2284,7 +2284,7 @@ static void macho32_init(void)
}
static const struct dfmt macho32_df_dwarf = {
"MachO32 (i386) dwarf debug format for Darwin/MacOS",
"Mach-O i386 dwarf for Darwin/MacOS",
"dwarf",
macho_dbg_init,
macho_dbg_linenum,
@ -2300,7 +2300,7 @@ static const struct dfmt * const macho32_df_arr[2] =
{ &macho32_df_dwarf, NULL };
const struct ofmt of_macho32 = {
"NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (i386) object files",
"Mach-O i386 (Mach, including MacOS X and variants)",
"macho32",
".o",
0,
@ -2351,7 +2351,7 @@ static void macho64_init(void)
}
static const struct dfmt macho64_df_dwarf = {
"MachO64 (x86-64) dwarf debug format for Darwin/MacOS",
"Mach-O x86-64 dwarf for Darwin/MacOS",
"dwarf",
macho_dbg_init,
macho_dbg_linenum,
@ -2367,7 +2367,7 @@ static const struct dfmt * const macho64_df_arr[2] =
{ &macho64_df_dwarf, NULL };
const struct ofmt of_macho64 = {
"NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (x86_64) object files",
"Mach-O x86-64 (Mach, including MacOS X and variants)",
"macho64",
".o",
0,

View File

@ -2668,7 +2668,7 @@ static const struct pragma_facility obj_pragma_list[] = {
};
const struct ofmt of_obj = {
"MS-DOS 16-bit/32-bit OMF object files",
"Intel/Microsoft OMF (MS-DOS, OS/2, Win16)",
"obj",
".obj",
0,