]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: fix Linux/ARM build
authorShenghou Ma <minux.ma@gmail.com>
Wed, 23 May 2012 03:36:24 +0000 (11:36 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Wed, 23 May 2012 03:36:24 +0000 (11:36 +0800)
        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

src/cmd/ld/ldelf.c

index 5100b3f4e3fa53b3f9a634aedca187fe027439c1..1f58573a683c0efe2db7f87ac7040735b9e94b9d 100644 (file)
@@ -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);