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/5l | |
| 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/5l')
| -rw-r--r-- | src/cmd/5l/5.out.h | 3 | ||||
| -rw-r--r-- | src/cmd/5l/obj.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/5l/5.out.h b/src/cmd/5l/5.out.h index cf86ae48b8..569536ebd7 100644 --- a/src/cmd/5l/5.out.h +++ b/src/cmd/5l/5.out.h @@ -35,7 +35,8 @@ #define NOPROF (1<<0) #define DUPOK (1<<1) #define NOSPLIT (1<<2) -#define ALLTHUMBS (1<<3) +#define RODATA (1<<3) +#define NOPTR (1<<4) #define REGRET 0 /* -1 disables use of REGARG */ diff --git a/src/cmd/5l/obj.c b/src/cmd/5l/obj.c index 4a3db99b00..f395925e15 100644 --- a/src/cmd/5l/obj.c +++ b/src/cmd/5l/obj.c @@ -540,7 +540,7 @@ loop: s->type = SBSS; s->value = 0; } - if(s->type != SBSS && !s->dupok) { + if(s->type != SBSS && s->type != SNOPTRDATA && !s->dupok) { diag("redefinition: %s\n%P", s->name, p); s->type = SBSS; s->value = 0; @@ -549,6 +549,10 @@ loop: s->size = p->to.offset; if(p->reg & DUPOK) s->dupok = 1; + if(p->from.scale & RODATA) + s->type = SRODATA; + else if(p->from.scale & NOPTR) + s->type = SNOPTRDATA; break; case ADATA: |
