Save object file name of each symbol in linker

This is useful to generate error messages when there is a symbol that
appears in more than one object file.

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 15:16:38 +01:00
parent 4e2a035838
commit 92449a4fe4
5 changed files with 34 additions and 17 deletions

View File

@@ -89,6 +89,7 @@ struct sSymbol {
SLONG nSectionID; /* internal to object.c */
struct sSection *pSection;
SLONG nOffset;
char *pzObjFileName; /* Object file where the symbol is located. */
char *pzFileName; /* Source file where the symbol was defined. */
ULONG nFileLine; /* Line where the symbol was defined. */
};

View File

@@ -4,7 +4,8 @@
#include "types.h"
void sym_Init(void);
void sym_CreateSymbol(char *tzName, SLONG nValue, SLONG nBank);
void sym_CreateSymbol(char *tzName, SLONG nValue, SLONG nBank,
char *tzObjFileName, char *tzFileName, ULONG nFileLine);
SLONG sym_GetValue(char *tzName);
SLONG sym_GetBank(char *tzName);