mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
use cached dynamic_relocations
This commit is contained in:
parent
1ebcf25fc0
commit
5b9e152248
1 changed files with 6 additions and 7 deletions
|
@ -86,6 +86,9 @@ pub(crate) fn preprocess_windows(
|
|||
}
|
||||
};
|
||||
|
||||
let dynamic_relocations = DynamicRelocationsPe::new(exec_data);
|
||||
let thunks_start_offset = find_thunks_start_offset(exec_data, &dynamic_relocations);
|
||||
|
||||
let optional_header = exec_obj.nt_headers().optional_header;
|
||||
|
||||
let optional_header_offset = exec_obj.dos_header().nt_headers_offset() as usize
|
||||
|
@ -116,9 +119,6 @@ pub(crate) fn preprocess_windows(
|
|||
})
|
||||
.collect();
|
||||
|
||||
let dynamic_relocations = DynamicRelocationsPe::new(exec_data);
|
||||
let thunks_start_offset = find_thunks_start_offset(exec_data, &dynamic_relocations);
|
||||
|
||||
let metadata = PeMetadata {
|
||||
dynhost_file_size: std::fs::metadata(out_filename).unwrap().len() as usize,
|
||||
image_base: optional_header.image_base.get(LE),
|
||||
|
@ -314,7 +314,6 @@ pub(crate) fn surgery_pe(
|
|||
data_bytes_added as u32,
|
||||
);
|
||||
|
||||
let dynamic_relocations = DynamicRelocationsPe::new(executable);
|
||||
let symbols: Vec<_> = symbols
|
||||
.into_iter()
|
||||
.map(|s| (s.name, s.offset_in_section as u64))
|
||||
|
@ -324,9 +323,9 @@ pub(crate) fn surgery_pe(
|
|||
|
||||
remove_dummy_dll_import_table(
|
||||
executable,
|
||||
dynamic_relocations.data_directories_offset_in_file,
|
||||
dynamic_relocations.imports_offset_in_file,
|
||||
dynamic_relocations.dummy_import_index,
|
||||
md.dynamic_relocations.data_directories_offset_in_file,
|
||||
md.dynamic_relocations.imports_offset_in_file,
|
||||
md.dynamic_relocations.dummy_import_index,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue