1

When I analyze the link map file which was generated by xcode, in the linker syntheized section, there is a data named "compact unwind info".

compact unwind info 858.57KB    858572  Unchecked

it take about 858kb space size. I want to know what the actual data in this space. it there any way to reduce this size?

the total output of linker synthesized section:

compact unwind info 858.57KB
helper helper   24B
objc image info 8B
non-lazy-pointer    8B
non-lazy-pointer-to-local: dyld_stub_binder 8B
non-lazy-pointer-to-local: _vm_page_size    8B
non-lazy-pointer-to-local: _tanh    8B
non-lazy-pointer-to-local: _tan 8B
non-lazy-pointer-to-local: _strdup  8B
non-lazy-pointer-to-local: _strcmp  8B
non-lazy-pointer-to-local: _sinh    8B
non-lazy-pointer-to-local: _sin 8B
non-lazy-pointer-to-local: _realloc 8B
non-lazy-pointer-to-local: _protocol_getName    8B
non-lazy-pointer-to-local: _object_getIndexedIvars  8B
non-lazy-pointer-to-local: _objc_readClassPair  8B
non-lazy-pointer-to-local: _objc_lookUpClass    8B
non-lazy-pointer-to-local: _objc_getRequiredClass   8B
non-lazy-pointer-to-local: _objc_getProtocol    8B
non-lazy-pointer-to-local: _objc_getMetaClass   8B
non-lazy-pointer-to-local: _objc_getClass   8B
non-lazy-pointer-to-local: _objc_copyClassNamesForImage 8B
non-lazy-pointer-to-local: _objc_allocateClassPair  8B
non-lazy-pointer-to-local: _malloc  8B
non-lazy-pointer-to-local: _mach_task_self_ 8B
.....
Kara
  • 6,115
  • 16
  • 50
  • 57
boo
  • 493
  • 6
  • 17

1 Answers1

6

Unwind info is the information necessary to unwind the stack when an exception is thrown/raised. Unwinding the stack involves determining where the frame pointer, stack pointer, return address, and any saved registers were stored so state can be restored for the previous frame. It also determines, for any given stack frame, if there's an unwind handler function, to handle "catch" and "finally" features of exception handling in languages like C++ and Objective-C.

All of that information for the current frame is determined from the instruction pointer. As execution proceeds through a function from its very first instruction, the details change because each instruction may modify the relevant registers and/or push or pop saved register values to and from the stack.

The unwind info describes how to determine from an instruction pointer where to find all of these values.

There are various forms of unwind info that can be embedded in a binary. One common form is DWARF unwind info. That is fairly space inefficient. Apple developed compact unwind info because, believe it or not, it actually uses much less space.

The details of the compact unwind info format can be found here.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154