Merge pull request #1836 from carlokok/feature/object_file_section

Cranelift: Module data apis should allow specifying the object file section
This commit is contained in:
Pat Hickey
2020-06-17 10:49:09 -07:00
committed by GitHub
4 changed files with 52 additions and 13 deletions

View File

@@ -211,8 +211,17 @@ impl Backend for FaerieBackend {
ref data_decls,
ref function_relocs,
ref data_relocs,
ref custom_segment_section,
} = data_ctx.description();
if let Some((segment, section)) = custom_segment_section {
return Err(cranelift_module::ModuleError::Backend(anyhow::anyhow!(
"Custom section not supported by cranelift-faerie: `{}:{}`",
segment,
section
)));
}
for &(offset, id) in function_relocs {
let to = &namespace.get_function_decl(&function_decls[id]).name;
self.artifact