Tool for snipping loader_commands in Mach-O on Apple M1 (aarch64) on BigSur.

experimental!
https://github.com/upx/upx/issues/424
	new file:   macho-snip/Makefile
	new file:   macho-snip/macho-snip.c
	new file:   macho-snip/udf.s
This commit is contained in:
John Reiser
2022-02-28 19:53:25 -08:00
committed by Markus F.X.J. Oberhumer
parent e5aeea9ed2
commit 972c76eb42
3 changed files with 298 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Required: Apple Command Line Developer Tools: "xcode-select --install"
# Downloads a few megabytes. Installs in a couple minutes.
# Required: Apple Xcode Developer Tools from Apple App Store.
# Must accept the license: Launch Xcode app,
# or run "xcodebuild -license" from Terminal after install.
# Downloads about 13GB (~20 minutes at 1Gb/s). Install takes
# ~45 minutes more on SSD, and ~40GB of space in the filesystem.
CFLAGS += -g
macho-snip: macho-snip.o udf
$(CC) $(CFLAGS) -o macho-snip macho-snip.o
udf.o: udf.s
gcc -c $<
# shortest main program; used as an example
udf: udf.o
gcc --verbose -nostartfiles -o udf $<
codesign --remove-signature udf
strip -N udf # removes all symbols