summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2016-02-17 15:51:08 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2016-02-17 15:51:08 -0800
commit0e8fcf1b6cbe4a9997270dac7e5e2c9c13e82cb9 (patch)
treecb9543e9c7ddee7a719b5bfbe70316aa2f31d843
parent86e31129f71a033fc06201d4ef51d6893355ac42 (diff)
downloadnasm-0e8fcf1b6cbe4a9997270dac7e5e2c9c13e82cb9.tar.gz
outelf*: remove type prefix from debugging functions
The debugging functions currently have unique prefix, which is good for debuggability but hides real code differences. Convert them to have the same name across files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--output/outelf32.c90
-rw-r--r--output/outelf64.c90
-rw-r--r--output/outelfx32.c90
3 files changed, 135 insertions, 135 deletions
diff --git a/output/outelf32.c b/output/outelf32.c
index 85536047..03325c00 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -157,24 +157,24 @@ static struct dfmt df_stabs;
static struct elf_symbol *lastsym;
/* common debugging routines */
-static void debug32_typevalue(int32_t);
-static void debug32_deflabel(char *, int32_t, int64_t, int, char *);
-static void debug32_directive(const char *, const char *);
+static void debug_typevalue(int32_t);
+static void debug_deflabel(char *, int32_t, int64_t, int, char *);
+static void debug_directive(const char *, const char *);
/* stabs debugging routines */
-static void stabs32_linenum(const char *filename, int32_t linenumber, int32_t);
-static void stabs32_output(int, void *);
-static void stabs32_generate(void);
-static void stabs32_cleanup(void);
+static void stabs_linenum(const char *filename, int32_t linenumber, int32_t);
+static void stabs_output(int, void *);
+static void stabs_generate(void);
+static void stabs_cleanup(void);
/* dwarf debugging routines */
-static void dwarf32_init(void);
-static void dwarf32_linenum(const char *filename, int32_t linenumber, int32_t);
-static void dwarf32_output(int, void *);
-static void dwarf32_generate(void);
-static void dwarf32_cleanup(void);
-static void dwarf32_findfile(const char *);
-static void dwarf32_findsect(const int);
+static void dwarf_init(void);
+static void dwarf_linenum(const char *filename, int32_t linenumber, int32_t);
+static void dwarf_output(int, void *);
+static void dwarf_generate(void);
+static void dwarf_cleanup(void);
+static void dwarf_findfile(const char *);
+static void dwarf_findsect(const int);
/*
* Special NASM section numbers which are used to define ELF special
@@ -1019,7 +1019,7 @@ static void elf_write(void)
which are the .stab , .stabstr and .rel.stab sections respectively */
/* this function call creates the stab sections in memory */
- stabs32_generate();
+ stabs_generate();
if (stabbuf && stabstrbuf && stabrelbuf) {
elf_section_header(p - shstrtab, SHT_PROGBITS, 0, stabbuf, false,
@@ -1040,7 +1040,7 @@ static void elf_write(void)
/* this function call creates the dwarf sections in memory */
if (dwarf_fsect)
- dwarf32_generate();
+ dwarf_generate();
elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false,
arangeslen, 0, 0, 1, 0);
@@ -1339,24 +1339,24 @@ static int elf_set_info(enum geninfo type, char **val)
static struct dfmt df_dwarf = {
"ELF32 (i386) dwarf debug format for Linux/Unix",
"dwarf",
- dwarf32_init,
- dwarf32_linenum,
- debug32_deflabel,
- debug32_directive,
- debug32_typevalue,
- dwarf32_output,
- dwarf32_cleanup
+ dwarf_init,
+ dwarf_linenum,
+ debug_deflabel,
+ debug_directive,
+ debug_typevalue,
+ dwarf_output,
+ dwarf_cleanup
};
static struct dfmt df_stabs = {
"ELF32 (i386) stabs debug format for Linux/Unix",
"stabs",
null_debug_init,
- stabs32_linenum,
- debug32_deflabel,
- debug32_directive,
- debug32_typevalue,
- stabs32_output,
- stabs32_cleanup
+ stabs_linenum,
+ debug_deflabel,
+ debug_directive,
+ debug_typevalue,
+ stabs_output,
+ stabs_cleanup
};
struct dfmt *elf32_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL };
@@ -1383,7 +1383,7 @@ struct ofmt of_elf32 = {
/* again, the stabs debugging stuff (code) */
-static void debug32_deflabel(char *name, int32_t segment, int64_t offset, int is_global,
+static void debug_deflabel(char *name, int32_t segment, int64_t offset, int is_global,
char *special)
{
(void)name;
@@ -1393,13 +1393,13 @@ static void debug32_deflabel(char *name, int32_t segment, int64_t offset, int is
(void)special;
}
-static void debug32_directive(const char *directive, const char *params)
+static void debug_directive(const char *directive, const char *params)
{
(void)directive;
(void)params;
}
-static void debug32_typevalue(int32_t type)
+static void debug_typevalue(int32_t type)
{
int32_t stype, ssize;
switch (TYM_TYPE(type)) {
@@ -1468,7 +1468,7 @@ static void debug32_typevalue(int32_t type)
/* stabs debugging routines */
-static void stabs32_linenum(const char *filename, int32_t linenumber,
+static void stabs_linenum(const char *filename, int32_t linenumber,
int32_t segto)
{
(void)segto;
@@ -1493,7 +1493,7 @@ static void stabs32_linenum(const char *filename, int32_t linenumber,
currentline = linenumber;
}
-static void stabs32_output(int type, void *param)
+static void stabs_output(int type, void *param)
{
struct symlininfo *s;
struct linelist *el;
@@ -1524,7 +1524,7 @@ static void stabs32_output(int type, void *param)
/* for creating the .stab , .stabstr and .rel.stab sections in memory */
-static void stabs32_generate(void)
+static void stabs_generate(void)
{
int i, numfiles, strsize, numstabs = 0, currfile, mainfileindex;
uint8_t *sbuf, *ssbuf, *rbuf, *sptr, *rptr;
@@ -1660,7 +1660,7 @@ static void stabs32_generate(void)
stabstrbuf = ssbuf;
}
-static void stabs32_cleanup(void)
+static void stabs_cleanup(void)
{
struct linelist *ptr, *del;
if (!stabslines)
@@ -1680,22 +1680,22 @@ static void stabs32_cleanup(void)
/* dwarf routines */
-static void dwarf32_init(void)
+static void dwarf_init(void)
{
ndebugs = 3; /* 3 debug symbols */
}
-static void dwarf32_linenum(const char *filename, int32_t linenumber,
+static void dwarf_linenum(const char *filename, int32_t linenumber,
int32_t segto)
{
(void)segto;
- dwarf32_findfile(filename);
+ dwarf_findfile(filename);
debug_immcall = 1;
currentline = linenumber;
}
/* called from elf_out with type == TY_DEBUGSYMLIN */
-static void dwarf32_output(int type, void *param)
+static void dwarf_output(int type, void *param)
{
int ln, aa, inx, maxln, soc;
struct symlininfo *s;
@@ -1711,7 +1711,7 @@ static void dwarf32_output(int type, void *param)
/* Check if section index has changed */
if (!(dwarf_csect && (dwarf_csect->section) == (s->section)))
- dwarf32_findsect(s->section);
+ dwarf_findsect(s->section);
/* do nothing unless line or file has changed */
if (!debug_immcall)
@@ -1751,7 +1751,7 @@ static void dwarf32_output(int type, void *param)
}
-static void dwarf32_generate(void)
+static void dwarf_generate(void)
{
uint8_t *pbuf;
int indx;
@@ -1984,7 +1984,7 @@ static void dwarf32_generate(void)
WRITELONG(pbuf,0); /* null ending offset */
}
-static void dwarf32_cleanup(void)
+static void dwarf_cleanup(void)
{
nasm_free(arangesbuf);
nasm_free(arangesrelbuf);
@@ -1998,7 +1998,7 @@ static void dwarf32_cleanup(void)
nasm_free(locbuf);
}
-static void dwarf32_findfile(const char * fname)
+static void dwarf_findfile(const char * fname)
{
int finx;
struct linelist *match;
@@ -2035,7 +2035,7 @@ static void dwarf32_findfile(const char * fname)
}
}
-static void dwarf32_findsect(const int index)
+static void dwarf_findsect(const int index)
{
int sinx;
struct sectlist *match;
diff --git a/output/outelf64.c b/output/outelf64.c
index f2a192a3..89e00e77 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -160,24 +160,24 @@ static struct dfmt df_stabs;
static struct elf_symbol *lastsym;
/* common debugging routines */
-static void debug64_typevalue(int32_t);
-static void debug64_deflabel(char *, int32_t, int64_t, int, char *);
-static void debug64_directive(const char *, const char *);
+static void debug_typevalue(int32_t);
+static void debug_deflabel(char *, int32_t, int64_t, int, char *);
+static void debug_directive(const char *, const char *);
/* stabs debugging routines */
-static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t);
-static void stabs64_output(int, void *);
-static void stabs64_generate(void);
-static void stabs64_cleanup(void);
+static void stabs_linenum(const char *filename, int32_t linenumber, int32_t);
+static void stabs_output(int, void *);
+static void stabs_generate(void);
+static void stabs_cleanup(void);
/* dwarf debugging routines */
-static void dwarf64_init(void);
-static void dwarf64_linenum(const char *filename, int32_t linenumber, int32_t);
-static void dwarf64_output(int, void *);
-static void dwarf64_generate(void);
-static void dwarf64_cleanup(void);
-static void dwarf64_findfile(const char *);
-static void dwarf64_findsect(const int);
+static void dwarf_init(void);
+static void dwarf_linenum(const char *filename, int32_t linenumber, int32_t);
+static void dwarf_output(int, void *);
+static void dwarf_generate(void);
+static void dwarf_cleanup(void);
+static void dwarf_findfile(const char *);
+static void dwarf_findsect(const int);
/*
* Special section numbers which are used to define ELF special
@@ -1104,7 +1104,7 @@ static void elf_write(void)
which are the .stab , .stabstr and .rel.stab sections respectively */
/* this function call creates the stab sections in memory */
- stabs64_generate();
+ stabs_generate();
if (stabbuf && stabstrbuf && stabrelbuf) {
elf_section_header(p - shstrtab, SHT_PROGBITS, 0, stabbuf, false,
@@ -1125,7 +1125,7 @@ static void elf_write(void)
/* this function call creates the dwarf sections in memory */
if (dwarf_fsect)
- dwarf64_generate();
+ dwarf_generate();
elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false,
arangeslen, 0, 0, 1, 0);
@@ -1430,24 +1430,24 @@ static int elf_set_info(enum geninfo type, char **val)
static struct dfmt df_dwarf = {
"ELF64 (x86-64) dwarf debug format for Linux/Unix",
"dwarf",
- dwarf64_init,
- dwarf64_linenum,
- debug64_deflabel,
- debug64_directive,
- debug64_typevalue,
- dwarf64_output,
- dwarf64_cleanup
+ dwarf_init,
+ dwarf_linenum,
+ debug_deflabel,
+ debug_directive,
+ debug_typevalue,
+ dwarf_output,
+ dwarf_cleanup
};
static struct dfmt df_stabs = {
"ELF64 (x86-64) stabs debug format for Linux/Unix",
"stabs",
null_debug_init,
- stabs64_linenum,
- debug64_deflabel,
- debug64_directive,
- debug64_typevalue,
- stabs64_output,
- stabs64_cleanup
+ stabs_linenum,
+ debug_deflabel,
+ debug_directive,
+ debug_typevalue,
+ stabs_output,
+ stabs_cleanup
};
struct dfmt *elf64_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL };
@@ -1473,7 +1473,7 @@ struct ofmt of_elf64 = {
};
/* common debugging routines */
-static void debug64_deflabel(char *name, int32_t segment, int64_t offset,
+static void debug_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
(void)name;
@@ -1483,13 +1483,13 @@ static void debug64_deflabel(char *name, int32_t segment, int64_t offset,
(void)special;
}
-static void debug64_directive(const char *directive, const char *params)
+static void debug_directive(const char *directive, const char *params)
{
(void)directive;
(void)params;
}
-static void debug64_typevalue(int32_t type)
+static void debug_typevalue(int32_t type)
{
int32_t stype, ssize;
switch (TYM_TYPE(type)) {
@@ -1558,7 +1558,7 @@ static void debug64_typevalue(int32_t type)
/* stabs debugging routines */
-static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t segto)
+static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segto)
{
(void)segto;
if (!stabs_filename) {
@@ -1581,7 +1581,7 @@ static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t se
}
-static void stabs64_output(int type, void *param)
+static void stabs_output(int type, void *param)
{
struct symlininfo *s;
struct linelist *el;
@@ -1612,7 +1612,7 @@ static void stabs64_output(int type, void *param)
/* for creating the .stab , .stabstr and .rel.stab sections in memory */
-static void stabs64_generate(void)
+static void stabs_generate(void)
{
int i, numfiles, strsize, numstabs = 0, currfile, mainfileindex;
uint8_t *sbuf, *ssbuf, *rbuf, *sptr, *rptr;
@@ -1750,7 +1750,7 @@ static void stabs64_generate(void)
stabstrbuf = ssbuf;
}
-static void stabs64_cleanup(void)
+static void stabs_cleanup(void)
{
struct linelist *ptr, *del;
if (!stabslines)
@@ -1770,22 +1770,22 @@ static void stabs64_cleanup(void)
/* dwarf routines */
-static void dwarf64_init(void)
+static void dwarf_init(void)
{
ndebugs = 3; /* 3 debug symbols */
}
-static void dwarf64_linenum(const char *filename, int32_t linenumber,
+static void dwarf_linenum(const char *filename, int32_t linenumber,
int32_t segto)
{
(void)segto;
- dwarf64_findfile(filename);
+ dwarf_findfile(filename);
debug_immcall = 1;
currentline = linenumber;
}
/* called from elf_out with type == TY_DEBUGSYMLIN */
-static void dwarf64_output(int type, void *param)
+static void dwarf_output(int type, void *param)
{
int ln, aa, inx, maxln, soc;
struct symlininfo *s;
@@ -1801,7 +1801,7 @@ static void dwarf64_output(int type, void *param)
/* Check if section index has changed */
if (!(dwarf_csect && (dwarf_csect->section) == (s->section)))
- dwarf64_findsect(s->section);
+ dwarf_findsect(s->section);
/* do nothing unless line or file has changed */
if (!debug_immcall)
@@ -1841,7 +1841,7 @@ static void dwarf64_output(int type, void *param)
}
-static void dwarf64_generate(void)
+static void dwarf_generate(void)
{
uint8_t *pbuf;
int indx;
@@ -2076,7 +2076,7 @@ static void dwarf64_generate(void)
WRITEDLONG(pbuf,0); /* null ending offset */
}
-static void dwarf64_cleanup(void)
+static void dwarf_cleanup(void)
{
nasm_free(arangesbuf);
nasm_free(arangesrelbuf);
@@ -2090,7 +2090,7 @@ static void dwarf64_cleanup(void)
nasm_free(locbuf);
}
-static void dwarf64_findfile(const char * fname)
+static void dwarf_findfile(const char * fname)
{
int finx;
struct linelist *match;
@@ -2127,7 +2127,7 @@ static void dwarf64_findfile(const char * fname)
}
}
-static void dwarf64_findsect(const int index)
+static void dwarf_findsect(const int index)
{
int sinx;
struct sectlist *match;
diff --git a/output/outelfx32.c b/output/outelfx32.c
index c217c7be..a3ecf796 100644
--- a/output/outelfx32.c
+++ b/output/outelfx32.c
@@ -159,24 +159,24 @@ static struct dfmt df_stabs;
static struct elf_symbol *lastsym;
/* common debugging routines */
-static void debugx32_typevalue(int32_t);
-static void debugx32_deflabel(char *, int32_t, int64_t, int, char *);
-static void debugx32_directive(const char *, const char *);
+static void debug_typevalue(int32_t);
+static void debug_deflabel(char *, int32_t, int64_t, int, char *);
+static void debug_directive(const char *, const char *);
/* stabs debugging routines */
-static void stabsx32_linenum(const char *filename, int32_t linenumber, int32_t);
-static void stabsx32_output(int, void *);
-static void stabsx32_generate(void);
-static void stabsx32_cleanup(void);
+static void stabs_linenum(const char *filename, int32_t linenumber, int32_t);
+static void stabs_output(int, void *);
+static void stabs_generate(void);
+static void stabs_cleanup(void);
/* dwarf debugging routines */
-static void dwarfx32_init(void);
-static void dwarfx32_linenum(const char *filename, int32_t linenumber, int32_t);
-static void dwarfx32_output(int, void *);
-static void dwarfx32_generate(void);
-static void dwarfx32_cleanup(void);
-static void dwarfx32_findfile(const char *);
-static void dwarfx32_findsect(const int);
+static void dwarf_init(void);
+static void dwarf_linenum(const char *filename, int32_t linenumber, int32_t);
+static void dwarf_output(int, void *);
+static void dwarf_generate(void);
+static void dwarf_cleanup(void);
+static void dwarf_findfile(const char *);
+static void dwarf_findsect(const int);
/*
* Special section numbers which are used to define ELF special
@@ -1065,7 +1065,7 @@ static void elf_write(void)
which are the .stab , .stabstr and .rel.stab sections respectively */
/* this function call creates the stab sections in memory */
- stabsx32_generate();
+ stabs_generate();
if (stabbuf && stabstrbuf && stabrelbuf) {
elf_section_header(p - shstrtab, SHT_PROGBITS, 0, stabbuf, false,
@@ -1086,7 +1086,7 @@ static void elf_write(void)
/* this function call creates the dwarf sections in memory */
if (dwarf_fsect)
- dwarfx32_generate();
+ dwarf_generate();
elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false,
arangeslen, 0, 0, 1, 0);
@@ -1389,24 +1389,24 @@ static int elf_set_info(enum geninfo type, char **val)
static struct dfmt df_dwarf = {
"ELFX32 (x86-64) dwarf debug format for Linux/Unix",
"dwarf",
- dwarfx32_init,
- dwarfx32_linenum,
- debugx32_deflabel,
- debugx32_directive,
- debugx32_typevalue,
- dwarfx32_output,
- dwarfx32_cleanup
+ dwarf_init,
+ dwarf_linenum,
+ debug_deflabel,
+ debug_directive,
+ debug_typevalue,
+ dwarf_output,
+ dwarf_cleanup
};
static struct dfmt df_stabs = {
"ELFX32 (x86-64) stabs debug format for Linux/Unix",
"stabs",
null_debug_init,
- stabsx32_linenum,
- debugx32_deflabel,
- debugx32_directive,
- debugx32_typevalue,
- stabsx32_output,
- stabsx32_cleanup
+ stabs_linenum,
+ debug_deflabel,
+ debug_directive,
+ debug_typevalue,
+ stabs_output,
+ stabs_cleanup
};
struct dfmt *elfx32_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL };
@@ -1432,7 +1432,7 @@ struct ofmt of_elfx32 = {
};
/* common debugging routines */
-static void debugx32_deflabel(char *name, int32_t segment, int64_t offset,
+static void debug_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
{
(void)name;
@@ -1442,13 +1442,13 @@ static void debugx32_deflabel(char *name, int32_t segment, int64_t offset,
(void)special;
}
-static void debugx32_directive(const char *directive, const char *params)
+static void debug_directive(const char *directive, const char *params)
{
(void)directive;
(void)params;
}
-static void debugx32_typevalue(int32_t type)
+static void debug_typevalue(int32_t type)
{
int32_t stype, ssize;
switch (TYM_TYPE(type)) {
@@ -1517,7 +1517,7 @@ static void debugx32_typevalue(int32_t type)
/* stabs debugging routines */
-static void stabsx32_linenum(const char *filename, int32_t linenumber, int32_t segto)
+static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segto)
{
(void)segto;
if (!stabs_filename) {
@@ -1540,7 +1540,7 @@ static void stabsx32_linenum(const char *filename, int32_t linenumber, int32_t s
}
-static void stabsx32_output(int type, void *param)
+static void stabs_output(int type, void *param)
{
struct symlininfo *s;
struct linelist *el;
@@ -1571,7 +1571,7 @@ static void stabsx32_output(int type, void *param)
/* for creating the .stab , .stabstr and .rel.stab sections in memory */
-static void stabsx32_generate(void)
+static void stabs_generate(void)
{
int i, numfiles, strsize, numstabs = 0, currfile, mainfileindex;
uint8_t *sbuf, *ssbuf, *rbuf, *sptr, *rptr;
@@ -1706,7 +1706,7 @@ static void stabsx32_generate(void)
stabstrbuf = ssbuf;
}
-static void stabsx32_cleanup(void)
+static void stabs_cleanup(void)
{
struct linelist *ptr, *del;
if (!stabslines)
@@ -1726,22 +1726,22 @@ static void stabsx32_cleanup(void)
/* dwarf routines */
-static void dwarfx32_init(void)
+static void dwarf_init(void)
{
ndebugs = 3; /* 3 debug symbols */
}
-static void dwarfx32_linenum(const char *filename, int32_t linenumber,
+static void dwarf_linenum(const char *filename, int32_t linenumber,
int32_t segto)
{
(void)segto;
- dwarfx32_findfile(filename);
+ dwarf_findfile(filename);
debug_immcall = 1;
currentline = linenumber;
}
/* called from elf_out with type == TY_DEBUGSYMLIN */
-static void dwarfx32_output(int type, void *param)
+static void dwarf_output(int type, void *param)
{
int ln, aa, inx, maxln, soc;
struct symlininfo *s;
@@ -1757,7 +1757,7 @@ static void dwarfx32_output(int type, void *param)
/* Check if section index has changed */
if (!(dwarf_csect && (dwarf_csect->section) == (s->section)))
- dwarfx32_findsect(s->section);
+ dwarf_findsect(s->section);
/* do nothing unless line or file has changed */
if (!debug_immcall)
@@ -1797,7 +1797,7 @@ static void dwarfx32_output(int type, void *param)
}
-static void dwarfx32_generate(void)
+static void dwarf_generate(void)
{
uint8_t *pbuf;
int indx;
@@ -2032,7 +2032,7 @@ static void dwarfx32_generate(void)
WRITELONG(pbuf,0); /* null ending offset */
}
-static void dwarfx32_cleanup(void)
+static void dwarf_cleanup(void)
{
nasm_free(arangesbuf);
nasm_free(arangesrelbuf);
@@ -2046,7 +2046,7 @@ static void dwarfx32_cleanup(void)
nasm_free(locbuf);
}
-static void dwarfx32_findfile(const char * fname)
+static void dwarf_findfile(const char * fname)
{
int finx;
struct linelist *match;
@@ -2083,7 +2083,7 @@ static void dwarfx32_findfile(const char * fname)
}
}
-static void dwarfx32_findsect(const int index)
+static void dwarf_findsect(const int index)
{
int sinx;
struct sectlist *match;