From: ceriel Date: Mon, 20 Oct 1986 09:35:51 +0000 (+0000) Subject: I don't really know why, but the file was changed. X-Git-Tag: release-5-5~5198 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8ffde3c86aadc10b15e42f47a148a0e8062c67e5;p=ack.git I don't really know why, but the file was changed. --- diff --git a/util/led/relocate.c b/util/led/relocate.c index 4164a7af5..bd06e2d9a 100644 --- a/util/led/relocate.c +++ b/util/led/relocate.c @@ -158,7 +158,19 @@ addrelo(relo, names, sects, valu_out) register ushort index = NLocals; register long valu = *valu_out; - if (ISUNDEFINED(local) || ISCOMMON(local)) { + if ((local->on_type & S_SCT)) { + register int sectindex = (local->on_type & S_TYP) - S_MIN; + + if (refers_zero(valu, relo, sects[sectindex].os_flen)) { + valu -= sects[sectindex].os_flen; + valu += outsect[sectindex].os_flen; + valu += relorig[sectindex].org_zero; + } else { + valu += relorig[sectindex].org_flen; + } + valu += outsect[sectindex].os_base; + index += NGlobals + sectindex; + } else { register struct outname *name; extern int hash(); extern struct outname *searchname(); @@ -174,20 +186,6 @@ addrelo(relo, names, sects, valu_out) valu += name->on_valu; index += NGlobals + (name->on_type & S_TYP) - S_MIN; } - } else { - register int sectindex = (local->on_type & S_TYP) - S_MIN; - - if (!(local->on_type & S_SCT)) - fatal("bad relocation index"); - if (refers_zero(valu, relo, sects[sectindex].os_flen)) { - valu -= sects[sectindex].os_flen; - valu += outsect[sectindex].os_flen; - valu += relorig[sectindex].org_zero; - } else { - valu += relorig[sectindex].org_flen; - } - valu += outsect[sectindex].os_base; - index += NGlobals + sectindex; } *valu_out = valu; return index;