mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Add undefined rc procs for LinkedData too
This commit is contained in:
parent
99369dec85
commit
ad127eb395
1 changed files with 30 additions and 24 deletions
|
@ -920,6 +920,8 @@ fn build_proc<'a, B: Backend<'a>>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Relocation::LinkedData { offset, name } => {
|
Relocation::LinkedData { offset, name } => {
|
||||||
|
add_undefined_rc_proc(output, name, &rc_proc_names);
|
||||||
|
|
||||||
if let Some(sym_id) = output.symbol_id(name.as_bytes()) {
|
if let Some(sym_id) = output.symbol_id(name.as_bytes()) {
|
||||||
if cfg!(all(target_arch = "aarch64", target_os = "linux")) {
|
if cfg!(all(target_arch = "aarch64", target_os = "linux")) {
|
||||||
// 700: 90000001 adrp x1, 0x0 <std.builtin.default_panic>
|
// 700: 90000001 adrp x1, 0x0 <std.builtin.default_panic>
|
||||||
|
@ -1005,6 +1007,21 @@ fn build_proc<'a, B: Backend<'a>>(
|
||||||
output.add_symbol(builtin_symbol);
|
output.add_symbol(builtin_symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_undefined_rc_proc(output, name, &rc_proc_names);
|
||||||
|
|
||||||
|
if let Some(sym_id) = output.symbol_id(name.as_bytes()) {
|
||||||
|
create_relocation(target_info, sym_id, offset + proc_offset)
|
||||||
|
} else {
|
||||||
|
internal_error!("failed to find fn symbol for {:?}", name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Relocation::JmpToReturn { .. } => unreachable!(),
|
||||||
|
};
|
||||||
|
relocations.push((section_id, elfreloc));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn add_undefined_rc_proc(output: &mut Object<'_>, name: &String, rc_proc_names: &Vec<'_, (symbol::Symbol, String)>) {
|
||||||
// If the symbol is an undefined reference counting procedure, we need to add it here.
|
// If the symbol is an undefined reference counting procedure, we need to add it here.
|
||||||
if output.symbol_id(name.as_bytes()).is_none() {
|
if output.symbol_id(name.as_bytes()).is_none() {
|
||||||
for (sym, rc_name) in rc_proc_names.iter() {
|
for (sym, rc_name) in rc_proc_names.iter() {
|
||||||
|
@ -1029,15 +1046,4 @@ fn build_proc<'a, B: Backend<'a>>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(sym_id) = output.symbol_id(name.as_bytes()) {
|
|
||||||
create_relocation(target_info, sym_id, offset + proc_offset)
|
|
||||||
} else {
|
|
||||||
internal_error!("failed to find fn symbol for {:?}", name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Relocation::JmpToReturn { .. } => unreachable!(),
|
|
||||||
};
|
|
||||||
relocations.push((section_id, elfreloc));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue