aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/8l
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/8l
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/8l')
-rw-r--r--src/cmd/8l/8.out.h1
-rw-r--r--src/cmd/8l/obj.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/8l/8.out.h b/src/cmd/8l/8.out.h
index 066192ef47..9d2751cf0a 100644
--- a/src/cmd/8l/8.out.h
+++ b/src/cmd/8l/8.out.h
@@ -34,6 +34,7 @@
#define DUPOK (1<<1)
#define NOSPLIT (1<<2)
#define RODATA (1<<3)
+#define NOPTR (1<<4)
enum as
{
diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c
index affdb57b7b..ccb4f7c23a 100644
--- a/src/cmd/8l/obj.c
+++ b/src/cmd/8l/obj.c
@@ -563,7 +563,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;
@@ -575,6 +575,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: