Extra assertions and fix for Faerie.
This commit is contained in:
@@ -211,8 +211,11 @@ impl Backend for FaerieBackend {
|
|||||||
ref data_decls,
|
ref data_decls,
|
||||||
ref function_relocs,
|
ref function_relocs,
|
||||||
ref data_relocs,
|
ref data_relocs,
|
||||||
|
section: ref datasection
|
||||||
} = data_ctx.description();
|
} = data_ctx.description();
|
||||||
|
|
||||||
|
assert!(datasection.is_none(), "Custom sections not supported");
|
||||||
|
|
||||||
for &(offset, id) in function_relocs {
|
for &(offset, id) in function_relocs {
|
||||||
let to = &namespace.get_function_decl(&function_decls[id]).name;
|
let to = &namespace.get_function_decl(&function_decls[id]).name;
|
||||||
self.artifact
|
self.artifact
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ impl Backend for ObjectBackend {
|
|||||||
};
|
};
|
||||||
self.object.section_id(section_kind)
|
self.object.section_id(section_kind)
|
||||||
} else {
|
} else {
|
||||||
|
assert!(!tls, "Tls data cannot be in named section");
|
||||||
let (seg, sec) = &datasection.as_ref().unwrap();
|
let (seg, sec) = &datasection.as_ref().unwrap();
|
||||||
self.object.add_section(seg.clone().into_bytes(), sec.clone().into_bytes(),
|
self.object.add_section(seg.clone().into_bytes(), sec.clone().into_bytes(),
|
||||||
if writable { SectionKind::Data } else { SectionKind::ReadOnlyData }
|
if writable { SectionKind::Data } else { SectionKind::ReadOnlyData }
|
||||||
|
|||||||
Reference in New Issue
Block a user