Some documentation was extracted from the C headers and is the property of Apple Inc.
core.sys.darwin.mach.nlist
Bindings for symbols and defines in mach-o/nlist.h
This file was created based on the MacOSX 10.15 SDK.
Copyright
Types 1
An entry in a list of symbols for 64-bits architectures
Said symbols can be used to describe many different type of data, including STABS debug infos. Introduced in MacOSX 10.8 SDK.
See Also
uint n_strxIndex of this symbol's name into the string tableubyte n_typeA bitfield that describes the type of this symbolubyte n_sectSection number (note that `0` means `NO_SECT`)ushort n_desculong n_valueFunctions 4
ubyte GET_COMM_ALIGN(uint n_desc) @safeCommon symbols are represented by undefined (NUNDF) external (NEXT) types who's values (nvalue) are non-zero. In which case the value of the nvalue field is the size (in bytes) of the common symbo...ubyte GET_LIBRARY_ORDINAL(uint n_desc) @safeFor images created by the static link editor with the -twolevelnamespace option in effect the flags field of the mach header is marked with MHTWOLEVEL. And the binding of the undefined references ...Variables 2
NO_SECT = 0Symbol is not in any section
If the type is N_SECT then the n_sect field contains an ordinal of the section the symbol is defined in. The sections are numbered from 1 and refer to sections in order they appear in the load commands for the file they are in. This means the same ordinal may very well refer to different sections in different files.
The n_value field for all symbol table entries (including N_STAB's) gets updated by the link editor based on the value of it's n_sect field and where the section n_sect references gets relocated. If the value of the n_sect field is NO_SECT then it's n_value field is not changed by the link editor.
MAX_SECT = 255Maximum number of sections: 1 thru 255 inclusive