diff options
| author | Russ Cox <rsc@golang.org> | 2012-02-19 03:19:52 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2012-02-19 03:19:52 -0500 |
| commit | 4e3f8e915fadd17b7caffaae273eddd3528ac080 (patch) | |
| tree | e5dd1e72fb0804a95996bb19af1a05ce435612bc /src/cmd/8l | |
| parent | f7410873ba731e4896c27f9ee866c18cb15668bf (diff) | |
| download | go-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.h | 1 | ||||
| -rw-r--r-- | src/cmd/8l/obj.c | 4 |
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: |
