Ignore symbols that don't contain rust as substring for executables

For staticlib we still keep checking symbols that don't contain rust as
substring.
This commit is contained in:
bjorn3 2025-02-26 14:05:24 +00:00
parent 83c0398856
commit 3866d1c30c

View file

@ -59,6 +59,13 @@ fn symbols_check(path: &str) {
continue; // Correctly mangled
}
if !name.contains("rust") {
// Assume that this symbol doesn't originate from rustc. This may
// be wrong, but even if so symbol_check_archive will likely
// catch it.
continue;
}
if name == "__rust_no_alloc_shim_is_unstable" {
continue; // FIXME remove exception once we mangle this symbol
}
@ -67,14 +74,6 @@ fn symbols_check(path: &str) {
continue; // Unfortunately LLVM doesn't allow us to mangle this symbol
}
if ["_start", "__dso_handle", "_init", "_fini", "__TMC_END__"].contains(&name) {
continue; // Part of the libc crt object
}
if name == "main" {
continue; // The main symbol has to be unmangled for the crt object to find it
}
panic!("Unmangled symbol found: {name}");
}
}