Fix linking bugs from wasm-objdump analysis

This commit is contained in:
Brian Carroll 2021-10-30 17:12:50 +01:00
parent 0ee482ae9e
commit b8eea9be2b
4 changed files with 57 additions and 21 deletions

View file

@ -105,9 +105,14 @@ pub fn build_module_help<'a>(
payload: linking_section_bytes,
});
// Code relocations
// We always output the code section at the same index relative to other sections, and we need that for relocations.
// TODO: If there's a data section, this will be 6 so we'll need logic for that
// TODO: Build a cleaner solution after we replace parity-wasm with our own module_builder
const CODE_SECTION_INDEX: u32 = 5;
let code_reloc_section = RelocationSection {
name: "reloc.CODE",
target_section_index: CODE_SECTION_INDEX,
entries: &backend.code_relocations,
};