Add all fns in compiler-rt that builtins are known to depend on

Also removes the workaround in the surigical linker.
This should mean we should get clear errors if we missed a function instead of crashes/segfaults.
This commit is contained in:
Brendan Hansknecht 2023-05-30 09:21:59 -07:00
parent 8c23053c1a
commit 81e8812f38
No known key found for this signature in database
GPG key ID: A199D0660F95F948
3 changed files with 330 additions and 72 deletions

View file

@ -1471,21 +1471,11 @@ fn surgery_elf_help(
}
}
} else {
// Explicitly ignore some symbols that are currently always linked.
const ALWAYS_LINKED: &[&str] = &["__divti3", "__udivti3"];
match app_obj.symbol_by_index(index) {
Ok(sym) if ALWAYS_LINKED.contains(&sym.name().unwrap_or_default()) => {
continue
}
_ => {
internal_error!(
"Undefined Symbol in relocation, {:+x?}: {:+x?}",
rel,
app_obj.symbol_by_index(index)
);
}
}
internal_error!(
"Undefined Symbol in relocation, {:+x?}: {:+x?}",
rel,
app_obj.symbol_by_index(index)
);
}
}