aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/malloc.goc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-02-09 00:34:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-02-09 00:34:55 +0000
commitcc240aa7d1b5fa87ca507f69a5df81a63cda2ce3 (patch)
tree7816f6072883911ab6d91b664bb121e5cbfff3e8 /libgo/runtime/malloc.goc
parent41798077bfd95dc55e0e1a16aa03dfe85435cbd4 (diff)
downloadgcc-cc240aa7d1b5fa87ca507f69a5df81a63cda2ce3.zip
gcc-cc240aa7d1b5fa87ca507f69a5df81a63cda2ce3.tar.gz
gcc-cc240aa7d1b5fa87ca507f69a5df81a63cda2ce3.tar.bz2
re PR go/69357 (libgo refers to _end in a non-weak way)
PR go/69537 runtime: Don't refer to _end symbol in shared library. Fixes GCC PR 69357. Reviewed-on: https://go-review.googlesource.com/19362 From-SVN: r233235
Diffstat (limited to 'libgo/runtime/malloc.goc')
-rw-r--r--libgo/runtime/malloc.goc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libgo/runtime/malloc.goc b/libgo/runtime/malloc.goc
index 473879c..0d86292 100644
--- a/libgo/runtime/malloc.goc
+++ b/libgo/runtime/malloc.goc
@@ -505,7 +505,8 @@ runtime_mallocinit(void)
{
byte *p, *p1;
uintptr arena_size, bitmap_size, spans_size, p_size;
- extern byte _end[];
+ uintptr *pend;
+ uintptr end;
uintptr limit;
uint64 i;
bool reserved;
@@ -613,7 +614,12 @@ 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.
- p = (byte*)ROUND((uintptr)_end + (1<<18), 1<<20);
+
+ end = 0;
+ pend = &__go_end;
+ if(pend != nil)
+ end = *pend;
+ p = (byte*)ROUND(end + (1<<18), 1<<20);
p_size = bitmap_size + spans_size + arena_size + PageSize;
p = runtime_SysReserve(p, p_size, &reserved);
if(p == nil)