If we don't specify -g, actually suppress debugging output
This commit is contained in:
parent
88dce03d8e
commit
bb88d011e3
2 changed files with 8 additions and 3 deletions
4
nasm.c
4
nasm.c
|
@ -173,6 +173,10 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If debugging info is disabled, suppress any debug calls */
|
||||||
|
if (!using_debug_info)
|
||||||
|
ofmt->current_dfmt = &null_debug_form;
|
||||||
|
|
||||||
if (ofmt->stdmac)
|
if (ofmt->stdmac)
|
||||||
pp_extra_stdmac (ofmt->stdmac);
|
pp_extra_stdmac (ofmt->stdmac);
|
||||||
parser_global_info (ofmt, &location);
|
parser_global_info (ofmt, &location);
|
||||||
|
|
|
@ -185,6 +185,7 @@ static int symtabsection;
|
||||||
static unsigned char *stabbuf=0,*stabstrbuf=0,*stabrelbuf=0;
|
static unsigned char *stabbuf=0,*stabstrbuf=0,*stabrelbuf=0;
|
||||||
static int stablen,stabstrlen,stabrellen;
|
static int stablen,stabstrlen,stabrellen;
|
||||||
|
|
||||||
|
static struct dfmt df_stabs;
|
||||||
|
|
||||||
void stabs_init(struct ofmt *,void *,FILE *,efunc );
|
void stabs_init(struct ofmt *,void *,FILE *,efunc );
|
||||||
void stabs_linenum(const char *filename,long linenumber,long);
|
void stabs_linenum(const char *filename,long linenumber,long);
|
||||||
|
@ -917,7 +918,7 @@ static void elf_write(void)
|
||||||
* sections `.comment', `.shstrtab', `.symtab' and `.strtab',
|
* sections `.comment', `.shstrtab', `.symtab' and `.strtab',
|
||||||
* then optionally relocation sections for the user sections.
|
* then optionally relocation sections for the user sections.
|
||||||
*/
|
*/
|
||||||
if (of_elf.current_dfmt)
|
if (of_elf.current_dfmt == &df_stabs)
|
||||||
nsections=8;
|
nsections=8;
|
||||||
else
|
else
|
||||||
nsections = 5; /* SHN_UNDEF and the fixed ones */
|
nsections = 5; /* SHN_UNDEF and the fixed ones */
|
||||||
|
@ -934,7 +935,7 @@ static void elf_write(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of_elf.current_dfmt) {
|
if (of_elf.current_dfmt == &df_stabs) {
|
||||||
/* in case the debug information is wanted, just add these three sections... */
|
/* in case the debug information is wanted, just add these three sections... */
|
||||||
add_sectname("",".stab");
|
add_sectname("",".stab");
|
||||||
add_sectname("",".stabstr");
|
add_sectname("",".stabstr");
|
||||||
|
@ -1019,7 +1020,7 @@ static void elf_write(void)
|
||||||
elf_section_header (p - shstrtab, 9, 0, sects[i]->rel, TRUE,
|
elf_section_header (p - shstrtab, 9, 0, sects[i]->rel, TRUE,
|
||||||
sects[i]->rellen, nsects+3, i+1, 4, 8);
|
sects[i]->rellen, nsects+3, i+1, 4, 8);
|
||||||
}
|
}
|
||||||
if (of_elf.current_dfmt) {
|
if (of_elf.current_dfmt == &df_stabs) {
|
||||||
/* for debugging information, create the last three sections
|
/* for debugging information, create the last three sections
|
||||||
which are the .stab , .stabstr and .rel.stab sections respectively */
|
which are the .stab , .stabstr and .rel.stab sections respectively */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue