Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Mach-O
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Link libraries === Link libraries are the same as any other Mach-O binary, just that there is no command that specifies the main entry point at which the program begins. There are three load commands for loading a link library file. Load command type {{code|0x0000000C}} are for the full file path to the dynamically linked shared library. Load command type {{code|0x0000000D}} are for dynamically linked shared locations from the application's current path. Load command type {{code|0x00000018}} is for a dynamically linked shared library that is allowed to be missing. The symbol names exist in other link libraries and are used if the library is missing meaning all symbols are weak imported. The link library command is read as follows: {| class="wikitable" |+ Load command (Link library) |- ! Offset !! Bytes !! Description |- | 0 || 4 || {{code|0x0000000C}} (Command type) {{code|0x0000000D}} (Command type) {{code|0x00000018}} (Command type) |- | 4 || 4 || Command size |- | 8 || 4 || String offset (always offset 24) |- | 12 || 4 || Time date stamp |- | 16 || 4 || Current version |- | 20 || 4 || Compatible version |- | 24 || Command size - 24 || File path string |} The file path name begins at the string offset, which is always 24. The number of bytes per text character is the remaining bytes in command size. The end of the library file path is identified by a character that is {{code|0x00}}. The remaining {{code|0x00}} values are used as padding, if any. ==== Link library ordinal numbers ==== The library is located by ordinal number in the compressed and uncompressed link edit information sections. Link libraries are numbered from ordinal 1 and up. The ordinal value zero is used in the symbol table to specify the symbol does not exist as an external symbol in another Mach-O binary. The link edit information will have no problem locating the appropriate library to read by ordinal number as long as you do not alter the order in which the link library commands go in. Link library command {{code|0x00000018}} should be avoided for performance reasons, as in the case the library is missing, then a search must be performed through all loaded link libraries.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)