about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-02-26 14:05:24 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-03-17 14:08:10 +0000
commit3866d1c30c0ca1a92dfb106d0b0f51250f951be9 (patch)
treefbab78f65a660a3ff9b4db8f7fb0a2ed138cedeb
parent83c0398856762562e3398c565fe2010c1d13e0aa (diff)
downloadrust-3866d1c30c0ca1a92dfb106d0b0f51250f951be9.tar.gz
rust-3866d1c30c0ca1a92dfb106d0b0f51250f951be9.zip
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.
-rw-r--r--tests/run-make/symbols-all-mangled/rmake.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/run-make/symbols-all-mangled/rmake.rs b/tests/run-make/symbols-all-mangled/rmake.rs
index a4c656722a7..244f68e511b 100644
--- a/tests/run-make/symbols-all-mangled/rmake.rs
+++ b/tests/run-make/symbols-all-mangled/rmake.rs
@@ -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}");
     }
 }