diff --git a/lib/runtime-core/src/module.rs b/lib/runtime-core/src/module.rs index e7af6a7daec..5814d9ff87e 100644 --- a/lib/runtime-core/src/module.rs +++ b/lib/runtime-core/src/module.rs @@ -78,7 +78,7 @@ pub struct ModuleInfo { pub em_symbol_map: Option>, /// Custom sections. - pub custom_sections: HashMap>, + pub custom_sections: HashMap>>, /// Flag controlling whether or not debug information for use in a debugger /// will be generated. @@ -102,7 +102,8 @@ impl ModuleInfo { let bytes = reader.read_bytes(len)?; let data = bytes.to_vec(); let name = name.to_string(); - self.custom_sections.insert(name, data); + let entry: &mut Vec> = self.custom_sections.entry(name).or_default(); + entry.push(data); } } Ok(())