aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/lib.c
diff options
context:
space:
mode:
authorShenghou Ma <minux@golang.org>2014-12-29 01:08:40 -0500
committerKeith Randall <khr@golang.org>2014-12-29 07:36:07 +0000
commitab0535ae3fb45ba734d47542cc4845f27f708d1b (patch)
tree0357ccba7c596a90470785ebd189416d15b6d74e /src/cmd/ld/lib.c
parent3b76b017cabb0ea29a184670e081edfe11afb8de (diff)
downloadgo-ab0535ae3fb45ba734d47542cc4845f27f708d1b.tar.xz
liblink, cmd/ld, runtime: remove stackguard1
Now that we've removed all the C code in runtime and the C compilers, there is no need to have a separate stackguard field to check for C code on Go stack. Remove field g.stackguard1 and rename g.stackguard0 to g.stackguard. Adjust liblink and cmd/ld as necessary. Change-Id: I54e75db5a93d783e86af5ff1a6cd497d669d8d33 Reviewed-on: https://go-review.googlesource.com/2144 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/ld/lib.c')
-rw-r--r--src/cmd/ld/lib.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c
index 925274bfd3..9c58c2276d 100644
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -1564,56 +1564,3 @@ diag(char *fmt, ...)
errorexit();
}
}
-
-void
-checkgo(void)
-{
- LSym *s;
- Reloc *r;
- int i;
- int changed;
-
- if(!debug['C'])
- return;
-
- // TODO(rsc,khr): Eventually we want to get to no Go-called C functions at all,
- // which would simplify this logic quite a bit.
-
- // Mark every Go-called C function with cfunc=2, recursively.
- do {
- changed = 0;
- for(s = ctxt->textp; s != nil; s = s->next) {
- if(s->cfunc == 0 || (s->cfunc == 2 && s->nosplit)) {
- for(i=0; i<s->nr; i++) {
- r = &s->r[i];
- if(r->sym == nil)
- continue;
- if((r->type == R_CALL || r->type == R_CALLARM) && r->sym->type == STEXT) {
- if(r->sym->cfunc == 1) {
- changed = 1;
- r->sym->cfunc = 2;
- }
- }
- }
- }
- }
- }while(changed);
-
- // Complain about Go-called C functions that can split the stack
- // (that can be preempted for garbage collection or trigger a stack copy).
- for(s = ctxt->textp; s != nil; s = s->next) {
- if(s->cfunc == 0 || (s->cfunc == 2 && s->nosplit)) {
- for(i=0; i<s->nr; i++) {
- r = &s->r[i];
- if(r->sym == nil)
- continue;
- if((r->type == R_CALL || r->type == R_CALLARM) && r->sym->type == STEXT) {
- if(s->cfunc == 0 && r->sym->cfunc == 2 && !r->sym->nosplit)
- print("Go %s calls C %s\n", s->name, r->sym->name);
- else if(s->cfunc == 2 && s->nosplit && !r->sym->nosplit)
- print("Go calls C %s calls %s\n", s->name, r->sym->name);
- }
- }
- }
- }
-}