Xcode settings - path to link map file - what is it?

Can someone explain what this parameter means and what it does?

EDIT: Thanks for the answers. Got it about crash reports. Let me ask about this: does the link map file really affect the execution of my application?

+7
source share
4 answers

A link map file is a text file that contains information about where the data, code, etc. are inside the executable file. It is very convenient for tracking the stack when a program crashes and memory is examined.

Just ask Xcode to do one, and then open it in textedit or whatever. You will see all the method names and variable names along with the addresses.

If you submit the application to the application store, it is vital to save the map file, so if Apple manages to collapse your application, you will have a better chance of making a header or tail of the crash report.

+7
source

Only relevant if you create link maps. If you look at the bottom of the settings window when you select the Path to the link map file , it says:

This parameter defines the path to the map file written by the linker when the configuration of the recording map file is activated. By default, a separate file will be written for each architecture and assembly option, and they will be generated in the Intermediates directory for the target whose products are associated. [LD_MAP_FILE_PATH, -map]

For a link file, the link file says:

Activating this option will force the linker to write the map file to disk, which details all the characters and their addresses in the output image. The path to the map file is determined by the configuration of the "Link Path" file. [LD_GENERATE_MAP_FILE, -map]

It’s rather unusual to be able to watch link maps if you don’t work with embedded systems.

+3
source

Default...

$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt .

So, for a goal called AtoZ ...

.../DerivedData/AtoZ/Intermediates/AtoZ.build/Debug/AtoZ.build/AtoZ-LinkMap-normal-x86_64.txt

An example of the output of such a file can be found here.

0
source

In the settings of your target assembly, make sure Write Link Map File set to YES

0
source

All Articles