Question

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!

Was it helpful?

Solution 2

Since I haven't got any additional answers or comments in a few days I thought I might as well answer this myself. The solution is basically what I put in a comment above:

The newest version of dyldinfo is located here:

http://opensource.apple.com/source/ld64/ld64-127.2/src/other/dyldinfo.cpp

However I still never figured out exactly what the function starts are used for, if anyone has info on that I'd still appreciate it.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top