Skip to content

Commit 4289dd0

Browse files
committed
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.
1 parent aa2ce2d commit 4289dd0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contrib/devtools/symbol-check.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ def check_exported_symbols(binary) -> bool:
212212
ok = False
213213
return ok
214214

215+
def check_RUNPATH(binary) -> bool:
216+
assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None
217+
assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None
218+
return True
219+
215220
def check_ELF_libraries(binary) -> bool:
216221
ok: bool = True
217222
for library in binary.libraries:
@@ -277,6 +282,7 @@ def check_ELF_ABI(binary) -> bool:
277282
('LIBRARY_DEPENDENCIES', check_ELF_libraries),
278283
('INTERPRETER_NAME', check_ELF_interpreter),
279284
('ABI', check_ELF_ABI),
285+
('RUNPATH', check_RUNPATH),
280286
],
281287
lief.EXE_FORMATS.MACHO: [
282288
('DYNAMIC_LIBRARIES', check_MACHO_libraries),

0 commit comments

Comments
 (0)