Make BANK(@) known at assembling time when possible

If the current section's bank is fixed, this means this value is
known prior to linking.
This commit is contained in:
ISSOtm
2019-09-08 22:28:28 +02:00
parent f262d3b34b
commit 54ed050ecf

View File

@@ -19,6 +19,7 @@
#include "asm/main.h" #include "asm/main.h"
#include "asm/rpn.h" #include "asm/rpn.h"
#include "asm/symbol.h" #include "asm/symbol.h"
#include "asm/output.h"
#include "asm/warning.h" #include "asm/warning.h"
#include "linkdefs.h" #include "linkdefs.h"
@@ -160,11 +161,14 @@ void rpn_BankSelf(struct Expression *expr)
{ {
rpn_Init(expr); rpn_Init(expr);
/* if (pCurrentSection->nBank == -1)
* This symbol is not really relocatable, but this makes the assembler /*
* write this expression as a RPN patch to the object file. * This is not really relocatable, but this makes the assembler
*/ * write this expression as a RPN patch to the object file.
expr->isReloc = 1; */
expr->isReloc = 1;
else
expr->nVal = pCurrentSection->nBank;
pushbyte(expr, RPN_BANK_SELF); pushbyte(expr, RPN_BANK_SELF);
expr->nRPNPatchSize++; expr->nRPNPatchSize++;