diff options
author | Charles Crayne <chuck@thor.crayne.org> | 2008-06-05 16:12:06 -0700 |
---|---|---|
committer | Charles Crayne <chuck@thor.crayne.org> | 2008-06-05 16:12:06 -0700 |
commit | 2d900f54888c7fb04318de2a4a862e7f84007981 (patch) | |
tree | 580bf79d246a22a400a64c3616000716a8a34903 | |
parent | 0d3b89bc4ec6cc891b03efb84cb92a6eea0faaf3 (diff) | |
download | nasm-2d900f54888c7fb04318de2a4a862e7f84007981.tar.gz |
Avoid obscure segfault in DWARF generation
If DWARF debugging info is requested, and no section
is marked executable, output empty debug sections,
instead of allowing assembler to segfault.
-rw-r--r-- | output/outelf32.c | 2 | ||||
-rw-r--r-- | output/outelf64.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/output/outelf32.c b/output/outelf32.c index 491b9ae4..63762b19 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -1185,7 +1185,7 @@ static void elf_write(void) /* for dwarf debugging information, create the ten dwarf sections */ /* this function call creates the dwarf sections in memory */ - dwarf32_generate(); + if (dwarf_fsect) dwarf32_generate(); p += strlen(p) + 1; elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false, diff --git a/output/outelf64.c b/output/outelf64.c index e7abba6d..3811a03f 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -1216,7 +1216,7 @@ static void elf_write(void) /* for dwarf debugging information, create the ten dwarf sections */ /* this function call creates the dwarf sections in memory */ - dwarf64_generate(); + if (dwarf_fsect) dwarf64_generate(); p += strlen(p) + 1; elf_section_header(p - shstrtab, SHT_PROGBITS, 0, arangesbuf, false, |