diff options
| author | Shenghou Ma <minux.ma@gmail.com> | 2013-03-11 14:24:51 +0800 |
|---|---|---|
| committer | Shenghou Ma <minux.ma@gmail.com> | 2013-03-11 14:24:51 +0800 |
| commit | 960d7082ee9b8fda91444167b3c253d5cf5e115d (patch) | |
| tree | 3a2f565bce8dad08128721c6af86e36a16a2c09c /src/pkg/runtime/cgo | |
| parent | 72dd01451f58a5b1a1cdd1d92810a8ab0d75d97d (diff) | |
| download | go-960d7082ee9b8fda91444167b3c253d5cf5e115d.tar.xz | |
cmd/ld, runtime/cgo: allow a symbol to be both cgo_export and cgo_import.
Fixes #4878.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7420052
Diffstat (limited to 'src/pkg/runtime/cgo')
| -rw-r--r-- | src/pkg/runtime/cgo/gcc_openbsd_386.c | 6 | ||||
| -rw-r--r-- | src/pkg/runtime/cgo/gcc_openbsd_amd64.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/runtime/cgo/gcc_openbsd_386.c b/src/pkg/runtime/cgo/gcc_openbsd_386.c index 86c1365adc..80be31b9c3 100644 --- a/src/pkg/runtime/cgo/gcc_openbsd_386.c +++ b/src/pkg/runtime/cgo/gcc_openbsd_386.c @@ -48,9 +48,9 @@ tcb_fixup(int mainthread) bcopy(oldtcb, newtcb + TLS_SIZE, TCB_SIZE); __set_tcb(newtcb + TLS_SIZE); - // The main thread TCB is a static allocation - do not try to free it. - if(!mainthread) - free(oldtcb); + // NOTE(jsing, minux): we can't free oldtcb without causing double-free + // problem. so newtcb will be memory leaks. Get rid of this when OpenBSD + // has proper support for PT_TLS. } static void * diff --git a/src/pkg/runtime/cgo/gcc_openbsd_amd64.c b/src/pkg/runtime/cgo/gcc_openbsd_amd64.c index d3a5e36b03..e9cc8184bd 100644 --- a/src/pkg/runtime/cgo/gcc_openbsd_amd64.c +++ b/src/pkg/runtime/cgo/gcc_openbsd_amd64.c @@ -48,9 +48,9 @@ tcb_fixup(int mainthread) bcopy(oldtcb, newtcb + TLS_SIZE, TCB_SIZE); __set_tcb(newtcb + TLS_SIZE); - // The main thread TCB is a static allocation - do not try to free it. - if(!mainthread) - free(oldtcb); + // NOTE(jsing, minux): we can't free oldtcb without causing double-free + // problem. so newtcb will be memory leaks. Get rid of this when OpenBSD + // has proper support for PT_TLS. } static void * |
