Verified Commit d04dc9c9 authored by Camil Staps's avatar Camil Staps 🙂

Prevent crash in bytecode prelinker if the input file contains no symbols

parent bd2e14f9
Pipeline #44295 passed with stages
in 15 minutes and 47 seconds
......@@ -216,7 +216,8 @@ int main(int argc, char **argv) {
write_section_varwidth(output_file, ST_Preamble, sizeof(prelinker_preamble)/sizeof(uint64_t), prelinker_preamble);
write_section_varwidth(output_file, ST_Code, program->code_size, program->code);
write_section_varwidth(output_file, ST_Data, program->data_size, program->data);
write_section(output_file, ST_Start, 1, &program->symbol_table[program->start_symbol_id].offset);
if (program->symbol_table_size>0)
write_section(output_file, ST_Start, 1, &program->symbol_table[program->start_symbol_id].offset);
fclose(output_file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment