* wasm32 obj writer: do the relocations before writing the code, data and debug sections

This commit is contained in:
Nikolay Nikolov 2022-08-03 20:56:44 +03:00
parent edf5fce7e3
commit e959422753

View File

@ -1915,6 +1915,8 @@ implementation
MaybeAddDebugSectionToSymbolTable('.debug_aranges',wcstDebugAranges,debug_aranges_section_nr);
MaybeAddDebugSectionToSymbolTable('.debug_ranges',wcstDebugRanges,debug_ranges_section_nr);
DoRelocations;
if segment_count>0 then
begin
WriteUleb(FWasmSections[wsiData],segment_count);
@ -1974,7 +1976,6 @@ implementation
MaybeWriteDebugSection('.debug_aranges',wcstDebugAranges);
MaybeWriteDebugSection('.debug_ranges',wcstDebugRanges);
DoRelocations;
WriteRelocations;
WriteSymbolTable;