CODESIGN_ALLOCATE(1)

πŸ“¦ version 1010.6, in nixpkgs unstable

πŸ’– CODESIGN_ALLOCATE(1) πŸ’–

okay bestie, welcome to codesign_allocate from the General Commands Manual, section 1. This is the little tool that handles adding code signing data to a Mach-O file, and yes it's giving β€œquiet backstage icon” energy. πŸŽ€

🌸 NAME 🌸

codesign_allocate β€” add code signing data to a Mach-O file

✨ SYNOPSIS ✨

codesign_allocate -i oldfile [ -a arch size ]... [ -A cputype cpusubtype size ]... -o newfile

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: codesign_allocate sets up a Mach-O file that the dynamic linker uses, so that space for code signing data β€” at the size you specify for the architecture you specify β€” is embedded in that Mach-O file. It's basically reserving the booth seats before the linker walks in. πŸ’…

And the rule for how many -a / -A args? Listen up: for a universal file, you have to pass one -a argument or one -A argument for each architecture in that universal file. For a thin file, you pass exactly one -a or -A. That's the vibe check, no cap.

  • -i oldfile β€” tells it the input file is oldfile. Hi, source file, come on in. 🫢
  • -o newfile β€” tells it the output file is newfile. That's where the glow-up gets written. ✨
  • -a arch size β€” for the architecture arch, sets the size of the code signing data to size. And bestie, size must be a multiple of 16. No exceptions, fr fr.
  • -A cputype cpusubtype size β€” for the architecture given as a pair of decimal integers, cputype and cpusubtype, sets the size of the code signing data to size. Same deal: size must be a multiple of 16. πŸŽ€
  • -r β€” removes the code signature data and the LC_CODE_SIGNATURE load command. It's literally the same as specifying the -a or -A option with a size of zero. Bye, signature data. πŸ‘‹
  • -p β€” page aligns the code signature data by padding the string table and changing its size. Heads up: this is not the default, because codesign(1) currently can't use this option. So it's iconic but not the everyday setting. πŸ’€
Lowkey important: those 16-multiple size rules for -a and -A are not suggestions. They're the requirement. Don't try to be cute with a random number. πŸ™ˆ

This page is from the General Commands Manual, brought to you by Apple, Inc., dated April 17, 2017 β€” yep, that's the source/version and date sign-off, bestie. CODESIGN_ALLOCATE(1) out. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from