mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
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.
This commit is contained in:
parent
0d3b89bc4e
commit
2d900f5488
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user