Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the use of .map files the linker produces?

What is the use of .map files VC++ linker produces when /MAP parameter or "Generate map file" project setting is used? When do I need them and how do I benefit from them?

like image 207
sharptooth Avatar asked Apr 16 '09 11:04

sharptooth


People also ask

What is the use of .map file?

You can use map files for debugging tools. You mean like opening the disassembly of the process and inspecting raw addresses? That is a possibility. Like I said, you need them rarely, but if you need them, you are glad they are available.

What is map file in linker?

A linker map is a file produced by the linker. The file shows the symbols and sections contained in a binary. The linker also provides the memory address and size for each symbol.

What does .map file contain?

The linker listing file or map file contains an abundance of information about the link/locate process and is composed of a number of sections, each of which is described below in the order in which they appear in the map file.


2 Answers

A nice article on how to use map files for finding crashes.

http://www.codeproject.com/KB/debug/mapfile.aspx

Manually doing all this is very uninteresting.

I am not aware of any tools which can read map file and help in finding the crash location. If anybody knows please update us.

like image 60
Canopus Avatar answered Oct 06 '22 02:10

Canopus


For embedded systems, map files are a lot more useful. (Although you wouldn't be using Visual C++ for that ;)

Things like knowing how close you are to running out of program/data memory, and what location a particular variable resides in, are important.

like image 23
Jason S Avatar answered Oct 06 '22 00:10

Jason S