From: nasm-bot f. H. P. A. <hp...@li...> - 2016-02-17 23:42:20
|
Commit-ID: 4b70bc25043af4030e3010b5a5c3e8ca5dbecaf9 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=4b70bc25043af4030e3010b5a5c3e8ca5dbecaf9 Author: H. Peter Anvin <hp...@li...> AuthorDate: Wed, 17 Feb 2016 14:37:26 -0800 Committer: H. Peter Anvin <hp...@li...> CommitDate: Wed, 17 Feb 2016 14:37:26 -0800 outelf32: move stabs32_linenum() so that it matches the other files Move the function stabs32_linenum() so that it is in the same location as in the other ELF backends; this eliminates a gratuitous difference. Signed-off-by: H. Peter Anvin <hp...@li...> --- output/outelf32.c | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index e4971ed..6737538 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -1384,32 +1384,6 @@ struct ofmt of_elf32 = { /* again, the stabs debugging stuff (code) */ -static void stabs32_linenum(const char *filename, int32_t linenumber, - int32_t segto) -{ - (void)segto; - - if (!stabs_filename) { - stabs_filename = (char *)nasm_malloc(strlen(filename) + 1); - strcpy(stabs_filename, filename); - } else { - if (strcmp(stabs_filename, filename)) { - /* - * yep, a memory leak...this program is one-shot anyway, so who cares... - * in fact, this leak comes in quite handy to maintain a list of files - * encountered so far in the symbol lines... - */ - - /* why not nasm_free(stabs_filename); we're done with the old one */ - - stabs_filename = (char *)nasm_malloc(strlen(filename) + 1); - strcpy(stabs_filename, filename); - } - } - debug_immcall = 1; - currentline = linenumber; -} - static void debug32_deflabel(char *name, int32_t segment, int64_t offset, int is_global, char *special) { @@ -1493,6 +1467,33 @@ static void debug32_typevalue(int32_t type) } } +/* stabs debugging routines */ + +static void stabs32_linenum(const char *filename, int32_t linenumber, + int32_t segto) +{ + (void)segto; + + if (!stabs_filename) { + stabs_filename = (char *)nasm_malloc(strlen(filename) + 1); + strcpy(stabs_filename, filename); + } else { + if (strcmp(stabs_filename, filename)) { + /* yep, a memory leak...this program is one-shot anyway, so who cares... + in fact, this leak comes in quite handy to maintain a list of files + encountered so far in the symbol lines... */ + + + /* why not nasm_free(stabs_filename); we're done with the old one */ + + stabs_filename = (char *)nasm_malloc(strlen(filename) + 1); + strcpy(stabs_filename, filename); + } + } + debug_immcall = 1; + currentline = linenumber; +} + static void stabs32_output(int type, void *param) { struct symlininfo *s; |