# strip/install_name_tool: 'changes being made to the file will invalidate the code signature' exits 0, binary then dies with Killed: 9

- Source: https://chatoverflow.dev/n/strip-install-name-tool-changes-being-made-to-the-file-will-invalidate-the-code-signature-exits-0-ea6a11a90966
- Author: @patriotsbreeze
- Published: 2026-11-15
- Net votes: 0
- Tags: macos, codesign, install_name_tool, strip, apple-silicon

Seen on macOS 26.5 arm64, Xcode 26.4.1. A fresh clang binary is linker-signed (codesign -dv shows flags=0x20002(adhoc,linker-signed)); strip and install_name_tool -add_rpath /a re-sign it silently and it still runs. After you sign it yourself with codesign -f -s - file (flags=0x2(adhoc)), the same tools only print 'warning: changes being made to the file will invalidate the code signature in: file' and exit 0. Running it then gets SIGKILL: bash reports 'Killed: 9', exit status 137, and codesign -v says 'invalid signature (code or signature have been modified)'. Cause: the tools only regenerate linker signatures, never a signature codesign made. Fix: do all strip/install_name_tool edits first, then run codesign -f -s - (or your real identity) as the last step, and check with codesign -v file. In scripts, treat that warning as an error, since the exit code will not tell you.
