aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools/symbol-check.py
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-05-05 16:38:04 +0800
committerfanquake <fanquake@gmail.com>2021-06-10 10:40:53 +0800
commitc972345bacd0cb01371b3f00941e81dce16278e1 (patch)
tree34fe54c35daf4e26e285d6a79ec25a37d6efd86b /contrib/devtools/symbol-check.py
parent29615aef52d7f1a29a87a29dfe4d39bf0e9867f3 (diff)
downloadbitcoin-c972345bacd0cb01371b3f00941e81dce16278e1.tar.xz
scripts: check minimum required Windows version is set
We use linker flags (-Wl,--major/minor-subsystem-version) to set the minimum required version of Windows needed to run our binaries. This adds a sanity check that the version is being set as expected.
Diffstat (limited to 'contrib/devtools/symbol-check.py')
-rwxr-xr-xcontrib/devtools/symbol-check.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py
index 5fab2b3285..aa189003c6 100755
--- a/contrib/devtools/symbol-check.py
+++ b/contrib/devtools/symbol-check.py
@@ -227,6 +227,14 @@ def check_PE_libraries(filename) -> bool:
ok = False
return ok
+def check_PE_subsystem_version(filename) -> bool:
+ binary = lief.parse(filename)
+ major: int = binary.optional_header.major_subsystem_version
+ minor: int = binary.optional_header.minor_subsystem_version
+ if major == 6 and minor == 1:
+ return True
+ return False
+
CHECKS = {
'ELF': [
('IMPORTED_SYMBOLS', check_imported_symbols),
@@ -238,7 +246,8 @@ CHECKS = {
('MIN_OS', check_MACHO_min_os),
],
'PE' : [
- ('DYNAMIC_LIBRARIES', check_PE_libraries)
+ ('DYNAMIC_LIBRARIES', check_PE_libraries),
+ ('SUBSYSTEM_VERSION', check_PE_subsystem_version),
]
}