X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=sect.c;h=cdf53ffc1ab5e650848211a030931580eb349a11;hp=0ea53a843f1c4568dec445fcab7c7f3a179ed014;hb=9afaf60ca24cdb08f900ae584107e29e3af46566;hpb=8f287ee72236774216a11a3062f9a26dc8dc66b6;ds=sidebyside diff --git a/sect.c b/sect.c index 0ea53a8..cdf53ff 100644 --- a/sect.c +++ b/sect.c @@ -415,6 +415,15 @@ int ResolveFixups(int sno) // evexpr presumably issues the errors/warnings here if (evexpr(fup->expr, &eval, &eattr, &esym) != OK) continue; + + if (CHECK_OPTS(OPT_PC_RELATIVE)) + if (eattr & REFERENCED) + if (eattr & DEFINED) + if (!(eattr & EQUATED)) + { + error("relocation not allowed"); + continue; + } } // Simple symbol else @@ -422,6 +431,15 @@ int ResolveFixups(int sno) SYM * sy = fup->symbol; eattr = sy->sattr; + if (CHECK_OPTS(OPT_PC_RELATIVE)) + if (eattr & REFERENCED) + if (eattr & DEFINED) + if (!(eattr & EQUATED)) + { + error("relocation not allowed"); + continue; + } + if (eattr & DEFINED) eval = sy->svalue; else @@ -498,7 +516,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"); } @@ -525,11 +543,13 @@ 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