From 008ffb73268bd36fc4c82f2b7915161caf6081d8 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 11 Nov 2025 09:30:20 +0100 Subject: [PATCH 1/3] gh-141376: make smelly: Don't ignore initialized data and BSS These exceptions were added in #23423 --- Tools/build/smelly.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Tools/build/smelly.py b/Tools/build/smelly.py index 9a360412a73a4d..0fb58bf5d6fa05 100755 --- a/Tools/build/smelly.py +++ b/Tools/build/smelly.py @@ -34,12 +34,6 @@ def is_local_symbol_type(symtype): if symtype.islower() and symtype not in "uvw": return True - # Ignore the initialized data section (d and D) and the BSS data - # section. For example, ignore "__bss_start (type: B)" - # and "_edata (type: D)". - if symtype in "bBdD": - return True - return False From 6158bf2f3f781ac7a71ca3534cfe9b51695adfb3 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 11 Nov 2025 09:36:48 +0100 Subject: [PATCH 2/3] Remove exceptions for _init and _fini I'm not sure if these are still needed --- Tools/build/smelly.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Tools/build/smelly.py b/Tools/build/smelly.py index 0fb58bf5d6fa05..b29b3bc81ef831 100755 --- a/Tools/build/smelly.py +++ b/Tools/build/smelly.py @@ -22,7 +22,6 @@ IGNORED_EXTENSION = "_ctypes_test" # Ignore constructor and destructor functions -IGNORED_SYMBOLS = {'_init', '_fini'} def is_local_symbol_type(symtype): @@ -83,8 +82,6 @@ def get_smelly_symbols(stdout, dynamic=False): if is_local_symbol_type(symtype): local_symbols.append(result) - elif symbol in IGNORED_SYMBOLS: - local_symbols.append(result) else: smelly_symbols.append(result) From 69667d493086725cd0076d7c409479b346f7fd71 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 11 Nov 2025 10:02:00 +0100 Subject: [PATCH 3/3] Remove outdated/misplaced comments --- Tools/build/smelly.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tools/build/smelly.py b/Tools/build/smelly.py index b29b3bc81ef831..424fa6ad4a1371 100755 --- a/Tools/build/smelly.py +++ b/Tools/build/smelly.py @@ -21,7 +21,6 @@ }) IGNORED_EXTENSION = "_ctypes_test" -# Ignore constructor and destructor functions def is_local_symbol_type(symtype): @@ -39,7 +38,6 @@ def is_local_symbol_type(symtype): def get_exported_symbols(library, dynamic=False): print(f"Check that {library} only exports symbols starting with Py or _Py") - # Only look at dynamic symbols args = ['nm', '--no-sort'] if dynamic: args.append('--dynamic')