Extra assertions and fix for Faerie.

This commit is contained in:
Carlo Kok
2020-06-08 07:22:36 +02:00
parent 6b47079884
commit 4ff01aa898
2 changed files with 4 additions and 0 deletions

View File

@@ -211,8 +211,11 @@ impl Backend for FaerieBackend {
ref data_decls,
ref function_relocs,
ref data_relocs,
section: ref datasection
} = data_ctx.description();
assert!(datasection.is_none(), "Custom sections not supported");
for &(offset, id) in function_relocs {
let to = &namespace.get_function_decl(&function_decls[id]).name;
self.artifact

View File

@@ -284,6 +284,7 @@ impl Backend for ObjectBackend {
};
self.object.section_id(section_kind)
} else {
assert!(!tls, "Tls data cannot be in named section");
let (seg, sec) = &datasection.as_ref().unwrap();
self.object.add_section(seg.clone().into_bytes(), sec.clone().into_bytes(),
if writable { SectionKind::Data } else { SectionKind::ReadOnlyData }