Does anyone know what the format of the data pointed to by the Mach-O LC_FUNCTION_STARTS command is?
The most information I could find is in the loader.h header file:
#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */
I see the dyldinfo tool has a -function_starts option which analyzes this data and the tool is open source, but the latest released version of the tool doesn't contain the support:
http://opensource.apple.com/source/ld64/ld64-97.2/src/other/dyldinfo.cpp
Does anyone know where I can get the source for the latest version of dyldinfo, or where I can get more information on this load command?
Thanks!
It's used by tools that need to symbolicate addresses in crash logs, samples, spindumps, etc. to determine if a given address falls inside a function. It could also be useful to debuggers to help them more quickly find the bounds of the function that a given address is within.
The data within this section is formatted as a zero-terminated sequence of DWARF-style ULEB128 values. The first value is the offset from the start of the __TEXT segment to the start of the first function. The remaining values is the offset to the start of the next function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With