Save location information of symbol definitions

Now, object files save the file name and line number where each global
symbol is defined.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-07-22 14:17:27 +01:00
parent 3dec5698db
commit 4dc376b0ee
7 changed files with 52 additions and 4 deletions

View File

@@ -126,7 +126,12 @@ obj_ReadSymbol(FILE * f)
}
readasciiz(&pSym->pzName, f);
if ((pSym->Type = (enum eSymbolType) fgetc(f)) != SYM_IMPORT) {
pSym->Type = (enum eSymbolType)fgetc(f);
if (pSym->Type != SYM_IMPORT) {
readasciiz(&pSym->pzFileName, f);
pSym->nFileLine = readlong(f);
pSym->nSectionID = readlong(f);
pSym->nOffset = readlong(f);
}