--- gforth/engine/main.c 2001/09/12 14:45:10 1.45 +++ gforth/engine/main.c 2001/09/16 08:59:48 1.46 @@ -126,16 +126,21 @@ int gforth_memcmp(const char * s1, const * If the word is 0: 0 is a null reference so don't adjust if (token>=base) { image[i]+=(Cell)start; } + } } } } @@ -499,7 +505,7 @@ Address loader(FILE *imagefile, char* fi imp=image+preamblesize; if (clear_dictionary) memset(imp+header.image_size, 0, dictsize-header.image_size); - { + if(header.base==0 || header.base == 0x100) { Cell reloc_size=((header.image_size-1)/sizeof(Cell))/8+1; char reloc_bits[reloc_size]; fseek(imagefile, preamblesize+header.image_size, SEEK_SET); @@ -513,6 +519,11 @@ Address loader(FILE *imagefile, char* fi } #endif } + else if(header.base!=imp) { + fprintf(stderr,"%s: Cannot load nonrelocatable image (compiled for address $%lx) at address $%lx\n", + progname, (unsigned long)header.base, (unsigned long)imp); + exit(1); + } if (header.checksum==0) ((ImageHeader *)imp)->checksum=check_sum; else if (header.checksum != check_sum) {