Merge .eh_frame without interpretation. Add a 0-CIE to the end.

Add unfinished attempt at using gimli, to be deleted but recorded in case we need it in the future.
This commit is contained in:
Nick Lewycky
2020-06-18 14:01:52 -07:00
parent 77c3ce5a33
commit e9d5c7896c
4 changed files with 109 additions and 12 deletions

View File

@@ -94,18 +94,20 @@ impl FuncTrampoline {
}
let mem_buf_slice = memory_buffer.as_slice();
let (function, sections, _eh_frame_section_indices) =
let (function, _sections, _eh_frame_section_indices) =
load_object_file(mem_buf_slice, FUNCTION_SECTION, None, |name: &String| {
Err(CompileError::Codegen(format!(
"trampoline generation produced reference to unknown function {}",
name
)))
})?;
/*
if !sections.is_empty() {
return Err(CompileError::Codegen(
"trampoline generation produced custom sections".into(),
));
}
*/
if !function.relocations.is_empty() {
return Err(CompileError::Codegen(
"trampoline generation produced relocations".into(),
@@ -175,18 +177,20 @@ impl FuncTrampoline {
}
let mem_buf_slice = memory_buffer.as_slice();
let (function, sections, _eh_frame_section_indices) =
let (function, _sections, _eh_frame_section_indices) =
load_object_file(mem_buf_slice, FUNCTION_SECTION, None, |name: &String| {
Err(CompileError::Codegen(format!(
"trampoline generation produced reference to unknown function {}",
name
)))
})?;
/*
if !sections.is_empty() {
return Err(CompileError::Codegen(
"trampoline generation produced custom sections".into(),
));
}
*/
if !function.relocations.is_empty() {
return Err(CompileError::Codegen(
"trampoline generation produced relocations".into(),