1

我想解析 lld 映射文件。有解释或文档吗?我检查了clang 文档lld 文档,但没有找到有用的信息。这是我的地图文件的示例

             VMA              LMA     Size Align Out     In      Symbol
      2002a8           2002a8       1d     1 .interp
      2002a8           2002a8       1d     1         <internal>:(.interp)
      2002c8           2002c8       20     4 .note.ABI-tag
      2002c8           2002c8       20     4         /opt/tiger/typhoon-blade/gccs/x86_64-x86_64-gcc-830/sysroot/usr/lib/../lib64/crt1.o:(.note.ABI-tag)
      2002e8           2002e8     24c0     8 .dynsym
      2002e8           2002e8     24c0     8         <internal>:(.dynsym)
      2027a8           2027a8      310     2 .gnu.version
      2027a8           2027a8      310     2         <internal>:(.gnu.version)
      202ab8           202ab8      170     4 .gnu.version_r
      202ab8           202ab8      170     4         <internal>:(.gnu.version_r)
      202c28           202c28       24     8 .gnu.hash
      202c28           202c28       24     8         <internal>:(.gnu.hash)
      202c4c           202c4c      c48     4 .hash
      202c4c           202c4c      c48     4         <internal>:(.hash)
      203894           203894     2c20     1 .dynstr
      203894           203894     2c20     1         <internal>:(.dynstr)
      2064b8           2064b8     9d50     8 .rela.dyn
      2064b8           2064b8     9d50     8         <internal>:(.rela.dyn)
      210208           210208     21f0     8 .rela.plt
      210208           210208     21f0     8         <internal>:(.rela.plt)
      212400           212400     b7b7    16 .rodata
      212400           212400        8     4         <internal>:(.rodata)
      212410           212410      262    16         build64_release/version.cpp.o:(.rodata)
      212410           212410        4     1                 kSvnInfoCount
      212420           212420      1e5     1                 kSvnInfo
      212605           212605        e     1                 kMainInfo
      212613           212613        8     1                 kBuildType
      212620           212620       19     1                 kBuildTime
      212640           212640       10     1                 kBuilderName
      212650           212650        d     1                 kHostName
      212660           212660       11     1                 kCompiler
      212671           212671        1     1                 kScmVersion
      212680           212680       80    16         <internal>:(.rodata)
      212700           212700     4bea     1         <internal>:(.rodata)
      2172ec           2172ec       18     4         build64_release/cpputil/json/libjson.a(json_params.cpp.o):(.rodata._ZNK9rapidjson12GenericValueINS_4UTF8IcEENS_12CrtAllocatorEE6AcceptINS_6WriterINS_19GenericStringBufferIS2_S3_EES2_S2_S3_EEEEbRT_)
      217304           217304       18     4         build64_release/cpputil/json/libjson.a(json_params.cpp.o):(.rodata._ZNK9rapidjson12GenericValueINS_4UTF8IcEENS_12CrtAllocatorEE6AcceptINS_12PrettyWriterINS_15FileWriteStreamES2_S2_S3_EEEEbRT_)
      21731c           21731c       84     4         build64_release/cpputil/json/libjson.a(json_params.cpp.o):(.rodata._ZN9rapidjson13GenericReaderINS_4UTF8IcEES2_NS_12CrtAllocatorEE10ParseValueILj0ENS_19GenericStringStreamIS2_EENS_19GenericDocumentLiteIS2_S3_S3_EEEEvRT0_RT1_)
4

1 回答 1

0

这个源文件的标题有一个模糊的格式轮廓,它是我最好的:

https://github.com/llvm/llvm-project/blob/main/lld/COFF/MapFile.cpp

它描述的格式与link.exe 相同。其中一些描述如下:

https://www.codeproject.com/Articles/3472/Finding-Crash-Information-Using-the-MAP-File

我希望我能提供更多帮助,因为我还需要更多信息。

于 2021-11-22T10:16:01.500 回答