I was wondering if someone familiar with CodeView/PDB/PE-COFF can answer on the following question: How to connect qsort’s S_GPROC32 with corresponding address in a DLL?
I have a simple program calling a
When there is a Symbol Table, it is trivial to relocate the symbol/connect the PC of function begin in the .text section with the symbol (DLLBase+Sym.Value()). When compiling it with Debug Symbols, the symbol table is empty/stripped away.
$ llvm-readobj --symbols ucrtbased.dll
$ llvm-readobj --coff-debug-directory ucrtbased.dll
we can see that
ucrtbased.pdb is PDB file describing this DLL.
By exploring the PDB we can find the symbol:
$ llvm-pdbutil dump --symbols ucrtbased.pdb
900 | S_GPROC32 [size = 48]
parent = 0, end = 1588, addr = 0001:763792, code size = 1805
0x24B6 (void (void*, unsigned __int64, u...), debug start = 45, debug end = 1781, flags = none
But it is not very clear to me how to connect this symbol information with the .text section of the DLL.