[PATCH] D134133: WIP: [lldb][COFF] Enhance symtab loading of symbol and export tables

Alvin Wong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 18 05:29:04 PDT 2022


alvinhochun created this revision.
alvinhochun added reviewers: labath, DavidSpickett, mstorsjo.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added projects: LLDB, LLVM.
Herald added subscribers: llvm-commits, lldb-commits.

This reimplements `ObjectFilePECOFF::ParseSymtab` with the following
changes:

- When the image has both an export table and a COFF symbol table, the symbols obtained from the symbol table no longer get erased.
- Remove manual data extraction in favour of using what `COFFObjectFile` provides.
- Mark symbols from the export table as "External" instead of "Debug".
- Support DLL forwarder exports (marked as re-exported).
- Handle absolute symbols in the symbol table.
- Heuristically set some symbol types. Symbols in the symbol table starting in `__imp_` (dllimport IAT reference) or `.refptr.` (mingw stub) are marked as "Data", because their locations store a pointer address.
- When a symbol in the symbol table is a duplicate of an exported symbol, its info will be synchronized with the exported symbol, then it will be marked as "Additional" type to avoid unwanted repetition when used in commands like `disassemble`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134133

Files:
  lldb/include/lldb/Symbol/Symtab.h
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
  lldb/source/Symbol/Symtab.cpp
  llvm/include/llvm/Object/COFF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134133.461069.patch
Type: text/x-patch
Size: 21677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220918/1e3efd17/attachment.bin>


More information about the llvm-commits mailing list