X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=sect.c;h=e0e47c6446aad4c4045fd64c9fa9f9523d2507ea;hb=cbc8347d4ffea164ca05b03e4e3be39945be8777;hp=781a81bda516c5e5fdbf7f0f06351a8a3e63f69e;hpb=fbbe9b115f949735421485513154ce8abb8453eb;p=rmac diff --git a/sect.c b/sect.c index 781a81b..e0e47c6 100644 --- a/sect.c +++ b/sect.c @@ -1,7 +1,7 @@ // -// RMAC - Reboot's Macro Assembler for all Atari computers +// RMAC - Renamed Macro Assembler for all Atari computers // SECT.C - Code Generation, Fixups and Section Management -// Copyright (C) 199x Landon Dyer, 2011-2020 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2021 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source utilised with the kind permission of Landon Dyer // @@ -416,14 +416,11 @@ int ResolveFixups(int sno) if (evexpr(fup->expr, &eval, &eattr, &esym) != OK) continue; - if (optim_pc) - if (eattr & REFERENCED) - if (eattr & DEFINED) - if (!(eattr & EQUATED)) - { - error("relocation not allowed"); - continue; - } + if ((CHECK_OPTS(OPT_PC_RELATIVE)) && (eattr & REFERENCED) && (eattr & DEFINED) && (!(eattr & EQUATED))) + { + error("relocation not allowed"); + continue; + } } // Simple symbol else @@ -431,14 +428,11 @@ int ResolveFixups(int sno) SYM * sy = fup->symbol; eattr = sy->sattr; - if (optim_pc) - if (eattr & REFERENCED) - if (eattr & DEFINED) - if (!(eattr & EQUATED)) - { - error("relocation not allowed"); - continue; - } + if ((CHECK_OPTS(OPT_PC_RELATIVE)) && (eattr & REFERENCED) && (eattr & DEFINED) && (!(eattr & EQUATED))) + { + error("relocation not allowed"); + continue; + } if (eattr & DEFINED) eval = sy->svalue; @@ -516,7 +510,7 @@ int ResolveFixups(int sno) } } - if (sbra_flag && (dw & FU_LBRA) && (eval + 0x80 < 0x100)) + if (optim_warn_flag && (dw & FU_LBRA) && (eval + 0x80 < 0x100)) warn("unoptimized short branch"); } @@ -543,11 +537,15 @@ int ResolveFixups(int sno) if (eval == 0) { - if (CHECK_OPTS(OPT_NULL_BRA)) + if (*locp) // optim_flags[OPT_NULL_BRA] is stored there, check the comment in mach.s under m_br { // Just output a NOP *locp++ = 0x4E; *locp = 0x71; + + if (optim_warn_flag) + warn("bra.s with zero offset converted to NOP"); + continue; } else @@ -902,8 +900,8 @@ int ResolveFixups(int sno) locp[1] = (uint8_t)eval; break; - // This is a 6 bit absoulte short address. It occupies - // the low 6 bits of the middle byte of a DSP word. + // This is a 6 bit absoulte short address. It occupies the low 6 + // bits of the middle byte of a DSP word. case FU_DSPADR06: if (eval > 63) { @@ -914,8 +912,8 @@ int ResolveFixups(int sno) locp[1] |= eval; break; - // This is a 6 bit absoulte short address. It occupies - // the low 6 bits of the middle byte of a DSP word. + // This is a 6 bit absoulte short address. It occupies the low 6 + // bits of the middle byte of a DSP word. case FU_DSPPP06: if (eval < 0xFFFFFFC0) {