MacOS: version information for unix / unix executables

This is a puzzle for me:

  • for the Bundles / Frameworks version is contained in Info.plist
  • for old applications that it puts in the fork resource

But today I found an executable file (LaunchDaemon), which is new, does not have a fork resource, does not have Info.plist, and has version 1.0.0.1110 according to the right panel in Finder. The question is, where is the version from?

+5
source share
2 answers

I do not know about the specific LaunchDaemon program that you are talking about, but in the general case, Info.plist can be embedded in an executable file during linking.

Pass -sectcreate __TEXT __info_plist path/to/Info.plist to ld or, equivalently, pass -Wl,-sectcreate,__TEXT,__info_plist,path/to/Info.plist compiler.

This is confirmed by Apple in the Code Signing Guide: Code Signing Tasks - adding Info.plist to single-file tools .

You can check what happens to the LaunchDaemon program you are referencing by looking at the output of otool -lV path/to/whatever .

+4
source

The dual launchd and launchctl files are the only single binaries that report the version number in Finder, as far as I can tell.

From Mac OS X and iOS Internals , it describes launchd launch as directly by the kernel, and also the name / sbin / launchd is hardcoded as the variable init_program_name. "

I suspect that the version number is also hardcoded so that Finder knows what to display, otherwise Finder sees this as a special known case.

If you use the β€œwhat” command, you can also see the version number in binary format, which in my case is 2.0.0 on Yosemite 10.10.2:

 $ what /sbin/launchd /sbin/launchd PROGRAM:launchd PROJECT:libxpc-559.10.3 VERSION:Darwin System Bootstrapper 2.0.0: Wed Nov 12 18:47:07 PST 2014; root:libxpc_executables-559.10.3~1/launchd/RELEASE_X86_64 
+1
source

Source: https://habr.com/ru/post/1213972/


All Articles