aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Voelker <[email protected]>1997-07-01 05:05:45 +0000
committerGeoff Voelker <[email protected]>1997-07-01 05:05:45 +0000
commite54c8cd1194ff791d17c7932a6080dda0838d7c8 (patch)
tree6e489f21c4c7b6057bc50a208c7faf40e0e01784 /src
parent333c25a99b7ebc65d98189e2a9f1e6a3ccecbec3 (diff)
Add pragma to force zero initialized
data into .data segment.
Diffstat (limited to 'src')
-rw-r--r--src/unexw32.c4
-rw-r--r--src/w32heap.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/src/unexw32.c b/src/unexw32.c
index d449a79eaa..ef4ed56fb9 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -39,6 +39,10 @@ typedef struct file_data {
unsigned char *file_base;
} file_data;
+/* Force zero initialized variables to be placed in the .data segment;
+ MSVC 5.0 otherwise places them in .bss, which breaks the dumping code. */
+#pragma data_seg(".data")
+
/* Basically, our "initialized" flag. */
BOOL need_to_recreate_heap = FALSE;
diff --git a/src/w32heap.c b/src/w32heap.c
index 2a92d059d9..8565999b45 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -66,6 +66,13 @@ cache_system_info (void)
syspage_mask = sysinfo_cache.dwPageSize - 1;
}
+/* Emulate getpagesize. */
+int
+getpagesize (void)
+{
+ return sysinfo_cache.dwPageSize;
+}
+
/* Round ADDRESS up to be aligned with ALIGN. */
unsigned char *
round_to_next (unsigned char *address, unsigned long align)
@@ -78,6 +85,10 @@ round_to_next (unsigned char *address, unsigned long align)
return (unsigned char *) (tmp * align);
}
+/* Force zero initialized variables to be placed in the .data segment;
+ MSVC 5.0 otherwise places them in .bss, which breaks the dumping code. */
+#pragma data_seg(".data")
+
/* Info for keeping track of our heap. */
unsigned char *data_region_base = NULL;
unsigned char *data_region_end = NULL;