From fe8f8c83d8dce53b0fb8aec5efc91e7ae55b8529 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 24 Jul 2013 17:37:07 +0000 Subject: runtime: Check _end rather than end to find end of program. This fixes a problem on Solaris, where end is not defined in the main program but comes from some shared library. This only matters for 32-bit targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201220 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/runtime/malloc.goc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgo') diff --git a/libgo/runtime/malloc.goc b/libgo/runtime/malloc.goc index dfab683950a..4b93e970769 100644 --- a/libgo/runtime/malloc.goc +++ b/libgo/runtime/malloc.goc @@ -319,7 +319,7 @@ runtime_mallocinit(void) { byte *p; uintptr arena_size, bitmap_size; - extern byte end[]; + extern byte _end[]; byte *want; uintptr limit; @@ -408,7 +408,7 @@ runtime_mallocinit(void) // So adjust it upward a little bit ourselves: 1/4 MB to get // away from the running binary image and then round up // to a MB boundary. - want = (byte*)(((uintptr)end + (1<<18) + (1<<20) - 1)&~((1<<20)-1)); + want = (byte*)(((uintptr)_end + (1<<18) + (1<<20) - 1)&~((1<<20)-1)); if(0xffffffff - (uintptr)want <= bitmap_size + arena_size) want = 0; p = runtime_SysReserve(want, bitmap_size + arena_size); -- cgit v1.2.1