mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
redirect libc functions to their roc equivalents
This commit is contained in:
parent
52404a4085
commit
2ad7dc0ca0
4 changed files with 23 additions and 20 deletions
|
@ -21,7 +21,7 @@ use roc_error_macros::internal_error;
|
|||
|
||||
use crate::{
|
||||
generate_dylib::APP_DLL, load_struct_inplace, load_struct_inplace_mut,
|
||||
load_structs_inplace_mut, open_mmap, open_mmap_mut,
|
||||
load_structs_inplace_mut, open_mmap, open_mmap_mut, redirect_libc_functions,
|
||||
};
|
||||
|
||||
/// The metadata stores information about/from the host .exe because
|
||||
|
@ -1062,15 +1062,13 @@ impl AppSections {
|
|||
|
||||
let address = symbol.as_ref().map(|s| s.address()).unwrap_or_default();
|
||||
let name = symbol.and_then(|s| s.name()).unwrap_or_default();
|
||||
let name = redirect_libc_functions(name).unwrap_or(name).to_string();
|
||||
|
||||
relocations
|
||||
.entry(name.to_string())
|
||||
.or_default()
|
||||
.push(AppRelocation {
|
||||
offset_in_section,
|
||||
address,
|
||||
relocation,
|
||||
});
|
||||
relocations.entry(name).or_default().push(AppRelocation {
|
||||
offset_in_section,
|
||||
address,
|
||||
relocation,
|
||||
});
|
||||
}
|
||||
_ => todo!(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue