summaryrefslogtreecommitdiff
path: root/src/cmd/ld/ldelf.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-07-22 12:10:18 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-07-22 12:10:18 +0400
commitc7f46d38d497464a800eb1d4a4b74dad78146de9 (patch)
treeaaa01d43301d17f7b142ffc1befcff4a59dd3fbf /src/cmd/ld/ldelf.c
parented0b93cb9e6d609c3d7ad2ead18725de29455ccc (diff)
downloadgo-c7f46d38d497464a800eb1d4a4b74dad78146de9.tar.gz
cmd/ld: mark hostobj sections as containing no pointers
Currently they are scanned conservatively. But there is no reason to scan them. C world must not contain pointers into Go heap. Moreover, we don't have enough information to emit write barriers nor update pointers there in future. The immediate need is that it breaks the new GC because these are weird symbols as if with pointers but not necessary pointer aligned. LGTM=rsc R=golang-codereviews, rlh, rsc CC=golang-codereviews, iant, khr https://codereview.appspot.com/117000043
Diffstat (limited to 'src/cmd/ld/ldelf.c')
-rw-r--r--src/cmd/ld/ldelf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
index 1d7c4c13e..38e414755 100644
--- a/src/cmd/ld/ldelf.c
+++ b/src/cmd/ld/ldelf.c
@@ -539,7 +539,7 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
s->type = SRODATA;
break;
case ElfSectFlagAlloc + ElfSectFlagWrite:
- s->type = SDATA;
+ s->type = SNOPTRDATA;
break;
case ElfSectFlagAlloc + ElfSectFlagExec:
s->type = STEXT;
@@ -572,7 +572,7 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
if(s->size < sym.size)
s->size = sym.size;
if(s->type == 0 || s->type == SXREF)
- s->type = SBSS;
+ s->type = SNOPTRBSS;
continue;
}
if(sym.shndx >= obj->nsect || sym.shndx == 0)