From: Shenghou Ma Date: Wed, 23 May 2012 03:36:24 +0000 (+0800) Subject: cmd/ld: fix Linux/ARM build X-Git-Tag: go1.1rc2~3137 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e0b0f62d96b37dd78811159d6ddd9819f374d603;p=gostls13.git cmd/ld: fix Linux/ARM build CL 5823055 removed a line introduced in Linux/ARM cgo support. Because readsym() now returns nil for "$a", "$d" mapping symbols, no matter the settings of `needSym', we still have to guard against them in ldelf(). R=golang-dev, dave, rsc CC=golang-dev https://golang.org/cl/6220073 --- diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c index 5100b3f4e3..1f58573a68 100644 --- a/src/cmd/ld/ldelf.c +++ b/src/cmd/ld/ldelf.c @@ -575,6 +575,9 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn) } if(sym.shndx >= obj->nsect || sym.shndx == 0) continue; + // even when we pass needSym == 1 to readsym, it might still return nil to skip some unwanted symbols + if(sym.sym == S) + continue; sect = obj->sect+sym.shndx; if(sect->sym == nil) { diag("%s: sym#%d: ignoring %s in section %d (type %d)", pn, i, sym.name, sym.shndx, sym.type);