From d8969b0d91cbbf0d03431488f397edc83b649159 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Thu, 8 Aug 2024 17:47:18 +0000 Subject: [PATCH] Ignore `__imp_` names when searching for symbols --- src/tools/run-make-support/src/symbols.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/tools/run-make-support/src/symbols.rs b/src/tools/run-make-support/src/symbols.rs index fd0c866bcc927..bb66e93138c76 100644 --- a/src/tools/run-make-support/src/symbols.rs +++ b/src/tools/run-make-support/src/symbols.rs @@ -28,12 +28,11 @@ pub fn any_symbol_contains(path: impl AsRef, substrings: &[&str]) -> bool with_symbol_iter(path, |syms| { for sym in syms { for substring in substrings { - if sym - .name_bytes() - .unwrap() - .windows(substring.len()) - .any(|x| x == substring.as_bytes()) - { + let name = sym.name_bytes().unwrap(); + if name.starts_with(b"__imp_") { + continue; + } + if name.windows(substring.len()).any(|x| x == substring.as_bytes()) { eprintln!("{:?} contains {}", sym, substring); return true; }