Skip to content

Commit 3866d1c

Browse files
committed
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.
1 parent 83c0398 commit 3866d1c

File tree

1 file changed

+7
-8
lines changed
  • tests/run-make/symbols-all-mangled

1 file changed

+7
-8
lines changed

tests/run-make/symbols-all-mangled/rmake.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ fn symbols_check(path: &str) {
5959
continue; // Correctly mangled
6060
}
6161

62+
if !name.contains("rust") {
63+
// Assume that this symbol doesn't originate from rustc. This may
64+
// be wrong, but even if so symbol_check_archive will likely
65+
// catch it.
66+
continue;
67+
}
68+
6269
if name == "__rust_no_alloc_shim_is_unstable" {
6370
continue; // FIXME remove exception once we mangle this symbol
6471
}
@@ -67,14 +74,6 @@ fn symbols_check(path: &str) {
6774
continue; // Unfortunately LLVM doesn't allow us to mangle this symbol
6875
}
6976

70-
if ["_start", "__dso_handle", "_init", "_fini", "__TMC_END__"].contains(&name) {
71-
continue; // Part of the libc crt object
72-
}
73-
74-
if name == "main" {
75-
continue; // The main symbol has to be unmangled for the crt object to find it
76-
}
77-
7877
panic!("Unmangled symbol found: {name}");
7978
}
8079
}

0 commit comments

Comments
 (0)