From: Austin Clements Date: Thu, 18 Dec 2014 20:28:58 +0000 (-0500) Subject: cmd/ld: clean up nested if when loading bind local syms X-Git-Tag: go1.5beta1~2565 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1e93125aa61a2695682e7cd43fd36b6356b9b08e;p=gostls13.git cmd/ld: clean up nested if when loading bind local syms Change-Id: I15269722ca3d2654a9dd7a3f8a89ad375dc9bee0 Reviewed-on: https://go-review.googlesource.com/1759 Reviewed-by: Russ Cox --- diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c index 243c8d8078..28d470bc3c 100644 --- a/src/cmd/ld/ldelf.c +++ b/src/cmd/ld/ldelf.c @@ -825,14 +825,18 @@ readsym(ElfObj *obj, int i, ElfSym *sym, int needSym) } break; case ElfSymBindLocal: - if(!(thechar == '5' && (strncmp(sym->name, "$a", 2) == 0 || strncmp(sym->name, "$d", 2) == 0))) // binutils for arm generate these mapping symbols, ignore these - if(needSym) { - // local names and hidden visiblity global names are unique - // and should only reference by its index, not name, so we - // don't bother to add them into hash table - s = linknewsym(ctxt, sym->name, ctxt->version); - s->type |= SHIDDEN; - } + if(thechar == '5' && (strncmp(sym->name, "$a", 2) == 0 || strncmp(sym->name, "$d", 2) == 0)) { + // binutils for arm generate these mapping + // symbols, ignore these + break; + } + if(needSym) { + // local names and hidden visiblity global names are unique + // and should only reference by its index, not name, so we + // don't bother to add them into hash table + s = linknewsym(ctxt, sym->name, ctxt->version); + s->type |= SHIDDEN; + } break; case ElfSymBindWeak: if(needSym) {