#include <mach-o/ldsyms.h>
mach-o/ldsyms.h
This file describes the link editor defined symbols. The semantics of a
link editor symbol is that it is defined by the link editor only if it is
referenced and it is an error for the user to define them (see the man page
ld(1)). The standard UNIX link editor symbols: __end, __etext and __edata
are not not supported by the Apple Mach-O link editor. These symbols are
really not meaningful in a Mach-O object file and the link editor symbols
that are supported (described here) replace them. In the case of the
standard UNIX link editor symbols the program can use the symbol
__mh_execute_header and walk the load commands of it's program to determine
the ending (or beginning) of any section or segment in the program. Note
that the compiler prepends an underbar to all external symbol names coded
in a high level language. Thus in 'C' names are coded without an underbar
and symbol names in the symbol table have an underbar. There are two cpp
macros for each link editor defined name in this file. The macro with a
leading underbar is the symbol name and the one without is the name as
coded in 'C'.
macro_MH_EXECUTE_SYM
The value of the link editor defined symbol _MH_EXECUTE_SYM is the address
of the mach header in a Mach-O executable file type. It does not appear in
any file type other than a MH_EXECUTE file type. The type of the symbol is
absolute as the header is not part of any section.
#define _MH_EXECUTE_SYM "__mh_execute_header"
macroMH_EXECUTE_SYM
#define MH_EXECUTE_SYM "_mh_execute_header"
variable_mh_execute_header
extern const struct mach_header_64 mach_header _mh_execute_header
macro_MH_BUNDLE_SYM
The value of the link editor defined symbol _MH_BUNDLE_SYM is the address
of the mach header in a Mach-O bundle file type. It does not appear in
any file type other than a MH_BUNDLE file type. The type of the symbol is
an N_SECT symbol even thought the header is not part of any section. This
symbol is private to the code in the bundle it is a part of.
#define _MH_BUNDLE_SYM "__mh_bundle_header"
macroMH_BUNDLE_SYM
#define MH_BUNDLE_SYM "_mh_bundle_header"
variable_mh_bundle_header
extern const struct mach_header_64 mach_header _mh_bundle_header
macro_MH_DYLIB_SYM
The value of the link editor defined symbol _MH_DYLIB_SYM is the address
of the mach header in a Mach-O dylib file type. It does not appear in
any file type other than a MH_DYLIB file type. The type of the symbol is
an N_SECT symbol even thought the header is not part of any section. This
symbol is private to the code in the library it is a part of.
#define _MH_DYLIB_SYM "__mh_dylib_header"
macroMH_DYLIB_SYM
#define MH_DYLIB_SYM "_mh_dylib_header"
variable_mh_dylib_header
extern const struct mach_header_64 mach_header _mh_dylib_header
macro_MH_DYLINKER_SYM
The value of the link editor defined symbol _MH_DYLINKER_SYM is the address
of the mach header in a Mach-O dylinker file type. It does not appear in
any file type other than a MH_DYLINKER file type. The type of the symbol is
an N_SECT symbol even thought the header is not part of any section. This
symbol is private to the code in the dynamic linker it is a part of.
#define _MH_DYLINKER_SYM "__mh_dylinker_header"
macroMH_DYLINKER_SYM
#define MH_DYLINKER_SYM "_mh_dylinker_header"
variable_mh_dylinker_header
extern const struct mach_header_64 mach_header _mh_dylinker_header