summaryrefslogtreecommitdiff
path: root/src/cmd/ld/ldelf.c
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-05-23 11:36:24 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-05-23 11:36:24 +0800
commit8047d058766d875040580337e2e818a32a1a314b (patch)
tree9ea81be72bb136353b9ce7ba917d9a8036618547 /src/cmd/ld/ldelf.c
parentdde835e24cc2d9ed74e26c4fa2390891ac382a09 (diff)
downloadgo-8047d058766d875040580337e2e818a32a1a314b.tar.gz
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 http://codereview.appspot.com/6220073
Diffstat (limited to 'src/cmd/ld/ldelf.c')
-rw-r--r--src/cmd/ld/ldelf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
index 5100b3f4e..1f58573a6 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);