An optional output file from a
linker program, also called a
list file. This file can give you some very useful information about the nature of the compiled program.
Most linkers break the map file up into 3 parts:
- A listing, in no particular order that I can determine, of the load address of every piece of memory linked into the program, be it data or function address. This is usually used in conjunction with part 2.
- A listing, by ascending load address, of data location, along with the data type (code, read/write, or read-only) and the object file that it was linked out of. Parts 1 and 2 are useful in determining where the heck your code halted when you get a weird error message about stopping at instruction 0x23a219, or when you are using a debugger that won't overlay your original source on top of the assembly instructions.
- A breakdown, by object, of the code size and memory requirements associated with that object. This is broken down into code size, inline code, inline string data, constant data, initialized data, zero-init data, and debug data. At the end of the list, you will get a helpful subtotal of this data that is related to objects that you built and other libraries that you linked to, and a grand total for each of these columns.
I usually find the last column to be the most useful in analysis of code size and efficiency, when I need to figure out where to start my
optimizations after getting everything up and running from the first pass.