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:
Charles Crayne 2008-06-05 16:12:06 -07:00
parent 0d3b89bc4e
commit 2d900f5488
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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,