www.delorie.com/djgpp/bugs/show.cgi | search |
Any of my source code compiled with djgpp 2.01 gcc 2.7.2.1 using the -pg switch locks up my PC (486SX, 8mb ram, 12mb free space). Programs compiled without this switch run fine with no errors.
The problems is caused by the profiling code calling functions that access the monchrome display memory in the PC. If that memory is being used for something else the program crashes. To workaround this change your the EMM386 args in config.sys so that the memory region between B000 and BFFF is not being used. If you cannot figure out the above then another way of doing it is to run memmaker and select Custom Setup when it asks you. Change the settings so that Use Monochrome Memory Region is No.
Patch src/libc/crt0/mcount.c with the patch below, recompile and put into the library. Then relink any program compiled with -pg option. *** src/libc/crt0/mcount.c~0 Thu Dec 26 13:59:04 1996 --- src/libc/crt0/mcount.c Thu Dec 26 13:56:06 1996 *************** void mcount(int _to) *** 64,70 **** to = *((&_to)-1) - 12; ebp = *((&_to)-2); /* glean the caller's return address from the stack */ from = ((int *)ebp)[1]; - _mono_printf("from %08x to %08x\n", from, to); if (*cache && ((*cache)->from == from) && ((*cache)->to == to)) { /* cache paid off - works quickly */ --- 64,69 ----
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |