Skip to content

Commit

Permalink
contrib: add R(UN)PATH check to ELF symbol-check
Browse files Browse the repository at this point in the history
Our binaries shouldn't contains any rpaths, or runpaths, so check that
at release time.
  • Loading branch information
fanquake committed Jun 20, 2024
1 parent aa2ce2d commit 4289dd0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/devtools/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -277,6 +282,7 @@ def check_ELF_ABI(binary) -> bool:
('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),
Expand Down

0 comments on commit 4289dd0

Please sign in to comment.