aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/6l
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-02-19 03:19:52 -0500
committerRuss Cox <rsc@golang.org>2012-02-19 03:19:52 -0500
commit4e3f8e915fadd17b7caffaae273eddd3528ac080 (patch)
treee5dd1e72fb0804a95996bb19af1a05ce435612bc /src/cmd/6l
parentf7410873ba731e4896c27f9ee866c18cb15668bf (diff)
downloadgo-4e3f8e915fadd17b7caffaae273eddd3528ac080.tar.xz
gc, ld: tag data as no-pointers and allocate in separate section
The garbage collector can avoid scanning this section, with reduces collection time as well as the number of false positives. Helps a little bit with issue 909, but certainly does not solve it. R=ken2 CC=golang-dev https://golang.org/cl/5671099
Diffstat (limited to 'src/cmd/6l')
-rw-r--r--src/cmd/6l/6.out.h1
-rw-r--r--src/cmd/6l/obj.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/6l/6.out.h b/src/cmd/6l/6.out.h
index 9a69c8ad52..559cdc758b 100644
--- a/src/cmd/6l/6.out.h
+++ b/src/cmd/6l/6.out.h
@@ -34,6 +34,7 @@
#define DUPOK (1<<1)
#define NOSPLIT (1<<2)
#define RODATA (1<<3)
+#define NOPTR (1<<4)
/*
* amd64
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index 5305c4b797..19f85f059e 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -555,7 +555,7 @@ loop:
s->type = SBSS;
s->size = 0;
}
- if(s->type != SBSS && !s->dupok) {
+ if(s->type != SBSS && s->type != SNOPTRDATA && !s->dupok) {
diag("%s: redefinition: %s in %s",
pn, s->name, TNAME);
s->type = SBSS;
@@ -567,6 +567,8 @@ loop:
s->dupok = 1;
if(p->from.scale & RODATA)
s->type = SRODATA;
+ else if(p->from.scale & NOPTR)
+ s->type = SNOPTRDATA;
goto loop;
case ADATA: