diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c index 1502ad6602..8cd256ca92 100644 --- a/src/cmd/6l/asm.c +++ b/src/cmd/6l/asm.c @@ -138,7 +138,8 @@ addstring(Sym *s, char *str) s->reachable = 1; r = s->size; n = strlen(str)+1; - elfsetstring(str, r); + if(strcmp(s->name, ".shstrtab") == 0) + elfsetstring(str, r); while(n > 0) { m = n; if(m > sizeof(p->to.scon)) diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c index ec35d8d519..1dd24b5bea 100644 --- a/src/cmd/8l/asm.c +++ b/src/cmd/8l/asm.c @@ -129,7 +129,8 @@ addstring(Sym *s, char *str) s->reachable = 1; r = s->size; n = strlen(str)+1; - elfsetstring(str, r); + if(strcmp(s->name, ".shstrtab") == 0) + elfsetstring(str, r); while(n > 0) { m = n; if(m > sizeof(p->to.scon))