William Jockusch
William Jockusch

Reputation: 27325

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

Can anyone explain what this setting means, and what it does?

EDIT: Thank you for the answers. Got it about the crash reports. Let me ask this -- does the link map file have any impact on my app's execution?

Upvotes: 12

Views: 15882

Answers (4)

hariszaman
hariszaman

Reputation: 8432

In your target build settings make sure Write Link Map File is set to YES

Upvotes: 0

Alex Gray
Alex Gray

Reputation: 16473

The default is...

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

So for a target, named AtoZ...

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

Sample output of such a file can be found here.

Upvotes: 0

Dave
Dave

Reputation: 3448

A link map file is a text file that details where data, code, etc lives inside your executable. Very handy for stack traces when your program crashes, and for examining memory.

Just ask Xcode to make one, and then open it in textedit or whatever. You'll see all your method names and variable names, alongside addresses.

If you submit your app to the app store, it's vital you keep your map file, so if Apple manage to crash your app, you'll stand a better chance of making head or tail of the crash report.

Upvotes: 9

Paul R
Paul R

Reputation: 213060

Only relevant if you're generating link maps. If you look at the bottom of the settings window when you select Path to Link Map File it says:

This setting defines the path to the map file written by the linker when the Write Link Map File setting is activated. By default a separate file will be written for each architecture and build variant, and these will be generated in the Intermediates directory for the target whose produce is being linked. [LD_MAP_FILE_PATH, -map]

For Write Link Map File it says:

Activating this setting will cause the linker to write a map file to disk which details all symbols and their addresses in the output image. The path to the map file is defined by the Path to Link Map File setting. [LD_GENERATE_MAP_FILE, -map]

It's fairly unusual to have any need to look at link maps, unless you're working on embedded systems.

Upvotes: 4

Related Questions