Commit Graph

6 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer f62576a2be CI updates and minor cleanups 2023-10-30 14:15:35 +01:00
Markus F.X.J. Oberhumer c75d7a685d src: major cleanups, introduce new eXtended Span class
- initial minimally invasive eXtended Span implementation
- rename ptr_diff to ptr_diff_bytes
- move some files to util subdir
- lots of cleanups
- start using the new checked pointers - this needs some real-world testing
2022-09-16 13:26:13 +02:00
John Reiser 540164849b whitespace
https://github.com/upx/upx/issues/446
	modified:   macho-snip.c
2022-03-01 16:05:37 -08:00
John Reiser 252143d0bb WIP: smallest executable on Apple M1 (aarch64 or arm64)
Requirements for success after snipping a loader_command:
    "codesign -s - my_app" must succeed.
    "lldb my_app; process launch -s; continue" must succeed.

Optional loader_commands (macho-snip can remove these successfully):
    LC_UUID, LC_BUILD_VERSION, LC_SOURCE_VERISON,
    LC_DATA_IN_CODE (when 0==datasize)

Apple "strip -N" clears out LC_SYMTAB and LC_DYSYMTAB, but leaves
LC_DYLD_INFO_ONLY.export_size.  Perhaps this could be zero if
constructed that way; snipping seems tedious because codesign
requires that __LINKEDIT must have no gaps.

LC_FUNCTION_STARTS seems to be required by codesign.
codesign wants offsets that point into __LINKEDIT to be in order:
    LC_DYLD_INFO_ONLY, LC_FUNCTION_STARTS, LC_DATA_IN_CODE, LC_SYMTAB

MacOS seesm to require LC_LOAD_DYLINKER (else "zsh: Kiled"),
which seems to require LD_LOAD_DYLIB (else SIGABRT).

https://github.com/upx/upx/issues/446
----
        modified:   macho-snip.c
	modified:   udf.s
2022-03-01 15:06:58 -08:00
John Reiser 480ab51650 Evade poratbility constraints of UPX build system
when building a tool to investigate "minimal" Mach-O executable
on Apple MacOS Big Sur using Apple M1 hardware (aarch64).
https://github.com/upx/upx/issues/567
	modified:   stub/tools/macho-snip/Makefile
	modified:   stub/tools/macho-snip/macho-snip.c
	modified:   stub/tools/macho-snip/udf.s
2022-03-01 11:12:19 -08:00
John Reiser 972c76eb42 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
2022-02-28 19:53:25 -08:00