aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/os_dep.c
diff options
context:
space:
mode:
authorHans Boehm <hans_boehm@hp.com>2001-04-05 00:14:18 +0000
committerTom Tromey <tromey@redhat.com>2001-04-05 00:14:18 +0000
commit549a6a722fe221e00f649fb6cde346769ae2f8f1 (patch)
tree88a556f74fb0052ef40f7b32c7dc19756675fe56 /boehm-gc/os_dep.c
parentdd205223bd61c32c83890fd70f53f56a805fee68 (diff)
2001-04-04 Hans Boehm <hans_boehm@hp.com>
* finalize.c: - Accomodate finalization requests for static objects. (Will be required by hash synchronization. May be needed in some configurations now.) * gc_priv.h: - Define MIN_WORDS. All allocation requests are rounded up to at least this size. Removes a subtle assumption that Java objects have a 2 word header. * gcconfig.h: - Adjust Linux/IA64 configuration for non-ancient kernels. (Necessary fix for IA64.) * linux_threads.c: - Fix syntax error in currently unused code. Will be needed for Linux/PA-RISC. * malloc.c: - Handle MIN_WORDS. * misc.c: - Handle MIN_WORDS. - Change stack cleaning code to typically clear about one tenth the memory it used to in the threads configuration. Occasionally still clear more. (This is really a fix for a long-standing and fairly significant performance bug with threads.) * os_dep.c: - Fix the code for finding the beginning of the data segment under Linux. I believe this is necessary for some IA64 Linux distributions. It will also helo other platforms, though those may additionally require a gcconfig.h adjustment. (This basically works around the absence of a data_start or __data_start definition in glibc.) * test.c: - Handle rounding due to MIN_WORDS. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@41102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/os_dep.c')
-rw-r--r--boehm-gc/os_dep.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 87f84e7bccd..a192d35a21a 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -144,20 +144,37 @@
#endif
#if defined(SEARCH_FOR_DATA_START)
- /* The following doesn't work if the GC is in a dynamic library. */
/* The I386 case can be handled without a search. The Alpha case */
/* used to be handled differently as well, but the rules changed */
/* for recent Linux versions. This seems to be the easiest way to */
/* cover all versions. */
- ptr_t GC_data_start;
- extern char * GC_copyright[]; /* Any data symbol would do. */
+# ifdef LINUX
+# pragma weak __data_start
+ extern int __data_start;
+# pragma weak data_start
+ extern int data_start;
+# endif /* LINUX */
+ extern int _end;
+
+ ptr_t GC_data_start;
void GC_init_linux_data_start()
{
extern ptr_t GC_find_limit();
- GC_data_start = GC_find_limit((ptr_t)GC_copyright, FALSE);
+# ifdef LINUX
+ /* Try the easy approaches first: */
+ if (&__data_start != 0) {
+ GC_data_start = (ptr_t)(&__data_start);
+ return;
+ }
+ if (&data_start != 0) {
+ GC_data_start = (ptr_t)(&data_start);
+ return;
+ }
+# endif /* LINUX */
+ GC_data_start = GC_find_limit((ptr_t)(&_end), FALSE);
}
#endif