Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/symbol-check.py
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | |||||
def check_version(max_versions, version, arch): | def check_version(max_versions, version, arch): | ||||
if '_' in version: | if '_' in version: | ||||
(lib, _, ver) = version.rpartition('_') | (lib, _, ver) = version.rpartition('_') | ||||
else: | else: | ||||
lib = version | lib = version | ||||
ver = '0' | ver = '0' | ||||
ver = tuple([int(x) for x in ver.split('.')]) | ver = tuple([int(x) for x in ver.split('.')]) | ||||
if not lib in max_versions: | if lib not in max_versions: | ||||
return False | return False | ||||
return ver <= max_versions[lib] or lib == 'GLIBC' and ver <= ARCH_MIN_GLIBC_VER[arch] | return ver <= max_versions[lib] or lib == 'GLIBC' and ver <= ARCH_MIN_GLIBC_VER[arch] | ||||
def read_libraries(filename): | def read_libraries(filename): | ||||
p = subprocess.Popen([READELF_CMD, '-d', '-W', filename], stdout=subprocess.PIPE, | p = subprocess.Popen([READELF_CMD, '-d', '-W', filename], stdout=subprocess.PIPE, | ||||
stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) | stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) | ||||
(stdout, stderr) = p.communicate() | (stdout, stderr) = p.communicate() | ||||
Show All 40 Lines |