36 |
#include "cyglacks.h" |
#include "cyglacks.h" |
37 |
#endif |
#endif |
38 |
|
|
39 |
|
#if 0 |
40 |
|
#ifdef __MINGW32__ |
41 |
|
# define SEPARATE_BSS_SECTION |
42 |
|
#endif |
43 |
|
#endif |
44 |
|
|
45 |
|
extern sigint(); |
46 |
|
|
47 |
/* Include relevant definitions from IMAGEHLP.H, which can be found |
/* Include relevant definitions from IMAGEHLP.H, which can be found |
48 |
in \\win32sdk\mstools\samples\image\include\imagehlp.h. */ |
in \\win32sdk\mstools\samples\image\include\imagehlp.h. */ |
49 |
|
|
140 |
{ |
{ |
141 |
extern void mainCRTStartup (void); |
extern void mainCRTStartup (void); |
142 |
|
|
143 |
#if 0 |
#if 1 |
144 |
/* Give us a way to debug problems with crashes on startup when |
/* Give us a way to debug problems with crashes on startup when |
145 |
running under the MSVC profiler. */ |
running under the MSVC profiler. */ |
146 |
if (GetEnvironmentVariable ("EMACS_DEBUG", NULL, 0) > 0) |
if (GetEnvironmentVariable ("EMACS_DEBUG", NULL, 0) > 0) |
709 |
printf ("\t0x%p BSS start in process.\n", bss_data); |
printf ("\t0x%p BSS start in process.\n", bss_data); |
710 |
printf ("\t0x%08lx BSS offset in executable.\n", index); |
printf ("\t0x%08lx BSS offset in executable.\n", index); |
711 |
printf ("\t0x%08lx BSS size in bytes.\n", size); |
printf ("\t0x%08lx BSS size in bytes.\n", size); |
712 |
|
printf ("\t0x%08lx file base.\n", p_outfile->file_base ); |
713 |
|
printf ("\t0x%08lx file base + index.\n", p_outfile->file_base + index ); |
714 |
memcpy ((char *) p_outfile->file_base + index, bss_data, size); |
memcpy ((char *) p_outfile->file_base + index, bss_data, size); |
715 |
} |
} |
716 |
|
|
750 |
i = GetLastError (); |
i = GetLastError (); |
751 |
exit (1); |
exit (1); |
752 |
} |
} |
753 |
|
printf ("\t0x%p BSS start in memory.\n", bss_start); |
754 |
|
printf ("\t0x%08lx BSS offset in saved executable.\n", index); |
755 |
|
printf ("\t0x%08lx BSS size in bytes.\n", bss_size); |
756 |
|
printf ("\t0x%08lx bytes read.\n", n_read); |
757 |
|
|
758 |
CloseHandle (file); |
CloseHandle (file); |
759 |
} |
} |
789 |
file_base = MapViewOfFileEx (file_mapping, FILE_MAP_COPY, 0, |
file_base = MapViewOfFileEx (file_mapping, FILE_MAP_COPY, 0, |
790 |
heap_index_in_executable, size, |
heap_index_in_executable, size, |
791 |
get_heap_start ()); |
get_heap_start ()); |
792 |
|
printf ("\t0x%p Heap start in memory.\n", get_heap_start() ); |
793 |
|
printf ("\t0x%08lx Heap offset in executable.\n", heap_index_in_executable); |
794 |
|
printf ("\t0x%08lx Heap size in bytes.\n", size); |
795 |
|
printf ("\t0x%08lx file base.\n", file_base); |
796 |
|
|
797 |
if (file_base != 0) |
if (file_base != 0) |
798 |
{ |
{ |
799 |
return; |
return; |
972 |
the region below the 256MB line for our malloc arena - 229MB is |
the region below the 256MB line for our malloc arena - 229MB is |
973 |
still a pretty decent arena to play in! */ |
still a pretty decent arena to play in! */ |
974 |
|
|
975 |
|
#if 0 |
976 |
unsigned long base = DBEGIN; /* 27MB */ |
unsigned long base = DBEGIN; /* 27MB */ |
977 |
/* unsigned long base = 0x01B00000; */ /* 27MB */ |
#else |
978 |
|
unsigned long base = 0x10100000 /*0x01B00000*/; /* 27MB */ |
979 |
|
#endif |
980 |
unsigned long end = 1 << VALBITS; /* 256MB */ |
unsigned long end = 1 << VALBITS; /* 256MB */ |
981 |
void *ptr = NULL; |
void *ptr = NULL; |
982 |
|
|
1001 |
MEM_RESERVE, |
MEM_RESERVE, |
1002 |
PAGE_NOACCESS); |
PAGE_NOACCESS); |
1003 |
DBEGIN = (DBEGIN_TY) ptr; |
DBEGIN = (DBEGIN_TY) ptr; |
1004 |
|
base = DBEGIN; |
1005 |
#endif |
#endif |
1006 |
|
|
1007 |
return ptr; |
return ptr; |