Mach-O LC_FUNCTION_STARTS Command File

Does anyone know what data format the Mach-O LC_FUNCTION_STARTS command points to?

Most of the information I can find is in the loader.h header file:

#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ 

I see that the dyldinfo tool has the -function_starts parameter, which parses this data, and the tool is open source, but the latest released version of the tool does not contain 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 can I get more information about this download command?

Thanks!

+4
source share
2 answers

Since I donโ€™t have any additional answers or comments in a few days, I thought I could answer it myself. The solution basically is what I added in the comments above:

The latest version of dyldinfo is here:

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

However, I still do not understand what the function is used for, if someone has information about this, I will still be grateful.

-1
source

It is used by tools that should symbolize addresses in crash logs, samples, spindumps, etc., to determine if a given address falls within a function. It can also be useful for debuggers to help them quickly find the boundaries of the function in which the given address is located.

The data in this section is formatted as a null-terminated sequence of ULEB128 DWARF-style values . The first value is the offset from the start of the __TEXT segment to the start of the first function. The remaining values โ€‹โ€‹are the offset to the beginning of the next function.

+7
source

Source: https://habr.com/ru/post/1400215/


All Articles