Fixed RDF/2 to comply with "maxbits" use.

This commit is contained in:
Keith Kanios 2007-04-18 02:24:34 +00:00
parent 0db11e236b
commit 7295e9856d
2 changed files with 5 additions and 2 deletions

View File

@ -194,6 +194,7 @@ static int32_t bsslength;
static void rdf_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
{
maxbits = 64;
ofile = fp;
error = errfunc;
seg[0] = newmembuf();
@ -423,7 +424,7 @@ static void rdf_out(int32_t segto, void *data, uint32_t type,
membufwrite(seg[segto], &rr.offset, -2);
} else if (type == OUT_REL4ADR) {
if (segment == segto)
if ((segment == segto) && (globalbits != 64))
error(ERR_PANIC, "intra-segment OUT_REL4ADR");
if (segment != NO_SEG && segment % 2) {
error(ERR_NONFATAL,

View File

@ -88,6 +88,8 @@ static void rdf2_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
(void)ldef;
(void)eval;
maxbits = 64;
int segtext, segdata, segbss;
/* set up the initial segments */
@ -624,7 +626,7 @@ static void rdf2_out(int32_t segto, const void *data, uint32_t type,
membufwrite(segto, &rr.offset, -2);
} else if (type == OUT_REL4ADR) {
if (segment == segto)
if ((segment == segto) && (globalbits != 64))
error(ERR_PANIC, "intra-segment OUT_REL4ADR");
if (segment != NO_SEG && segment % 2) {
error(ERR_PANIC, "erm... 4 byte segment base ref?");