Skip to content

Commit

Permalink
staticx: Ignore problem stripping binaries
Browse files Browse the repository at this point in the history
Older versions of patchelf (including the latest release, 0.9) can render
binaries unable to be stripped. Provided strip only replaces the input
binary if it is successful, we can safely hide and ignore this error.

See NixOS/patchelf#117
  • Loading branch information
JonathonReinhart committed Jul 15, 2017
1 parent 9a59de4 commit ed2d64a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion staticx/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def _prepare(self, path):

if self.strip:
logging.info("Stripping binary {}".format(dst))
strip_elf(dst)
try:
strip_elf(dst)
except ToolError as e:
pass

return dst

Expand Down
6 changes: 5 additions & 1 deletion staticx/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ def run(self, *args):
stderr_ignore = [
b'working around a Linux kernel bug by creating a hole',
])
tool_strip = ExternTool('strip', 'binutils')
tool_strip = ExternTool('strip', 'binutils',
stderr_ignore = [
'Not enough room for program headers, try linking with -N',
'[.note.ABI-tag]: Bad value',
])

def get_shobj_deps(path):
output = tool_ldd.run(path)
Expand Down

0 comments on commit ed2d64a

Please sign in to comment.