LoginSignup
1
0

More than 3 years have passed since last update.

Visual C++の作成する.MAPファイルのメモ

Posted at

近年はあまり使用しなくなりましたが、レガシーな環境ではリンカー(link.exe)が作成する.MAPファイルにお世話になることがあるかと思います。

ファイルを見れば意味はなんとなくわかりますが、ググラビリティが低いので自分用にメモします。

現在は、ビルド時間の観点からMAPファイルの出力は非推奨のようです。

Build Time Improvement Recommendation: Turn off /MAP, use PDBs
https://devblogs.microsoft.com/cppblog/build-time-improvement-recommendation-turn-off-map-use-pdbs/

Map files are an old technology: with modern releases of the MSVC toolset, PDB (Program Database) files do everything map files do and more.

Producing a map file takes a long time.

リンク

シンボルについているfとかi

MAPファイルに、Rva+BaseとLib:Objectの間に、こんな感じでフラグっぽいものが存在します。

  Address         Publics by Value              Rva+Base       Lib:Object
...
 0002:00001e90       ??$WriteResultString@PBD@details@wil@@YAPAEPAE0PBDPAPBD@Z 00412e90 f i Main.obj

Stackoverflowによると、fはFunction、iはinlineのようです。

Unknown flag in .MAP file format
https://stackoverflow.com/questions/24102976/unknown-flag-in-map-file-format

the "f" means "function".

I can reverse-engineer "i" to "inline", a function in the COMDAT section.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0