From 4289dd02cce688a69c596f7cd5e47f831b00aa1b Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 4 Jun 2024 13:06:25 +0100 Subject: [PATCH] contrib: add R(UN)PATH check to ELF symbol-check Our binaries shouldn't contains any rpaths, or runpaths, so check that at release time. --- contrib/devtools/symbol-check.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 6613874ce37..1d487d4f6be 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -212,6 +212,11 @@ def check_exported_symbols(binary) -> bool: ok = False return ok +def check_RUNPATH(binary) -> bool: + assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None + assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None + return True + def check_ELF_libraries(binary) -> bool: ok: bool = True for library in binary.libraries: @@ -277,6 +282,7 @@ lief.EXE_FORMATS.ELF: [ ('LIBRARY_DEPENDENCIES', check_ELF_libraries), ('INTERPRETER_NAME', check_ELF_interpreter), ('ABI', check_ELF_ABI), + ('RUNPATH', check_RUNPATH), ], lief.EXE_FORMATS.MACHO: [ ('DYNAMIC_LIBRARIES', check_MACHO_libraries),