don't allocate .reloc section when there are no pages

This commit is contained in:
Nikita Smith
2024-10-18 11:05:51 -07:00
parent 00dd4ad6ec
commit 36f3924160
+2 -1
View File
@@ -1946,7 +1946,7 @@ lnk_build_base_relocs(TP_Context *tp,
ProfEnd(); ProfEnd();
// push storage for section if (main_page_list->count > 0) {
LNK_Section *base_reloc_sect = lnk_section_table_push(st, str8_lit(".reloc"), LNK_RELOC_SECTION_FLAGS); LNK_Section *base_reloc_sect = lnk_section_table_push(st, str8_lit(".reloc"), LNK_RELOC_SECTION_FLAGS);
LNK_Symbol *base_reloc_symbol = lnk_make_defined_symbol_chunk(symtab->arena, str8_lit(LNK_BASE_RELOC_SYMBOL_NAME), LNK_DefinedSymbolVisibility_Internal, 0, base_reloc_sect->root, 0, 0, 0); LNK_Symbol *base_reloc_symbol = lnk_make_defined_symbol_chunk(symtab->arena, str8_lit(LNK_BASE_RELOC_SYMBOL_NAME), LNK_DefinedSymbolVisibility_Internal, 0, base_reloc_sect->root, 0, 0, 0);
lnk_symbol_table_push(symtab, base_reloc_symbol); lnk_symbol_table_push(symtab, base_reloc_symbol);
@@ -2011,6 +2011,7 @@ lnk_build_base_relocs(TP_Context *tp,
hash_table_purge(voff_ht); hash_table_purge(voff_ht);
} }
ProfEnd(); ProfEnd();
}
tp_temp_end(temp); tp_temp_end(temp);
ProfEnd(); ProfEnd();