Skip to content

Commit

Permalink
cmd/ld: clean up nested if when loading bind local syms
Browse files Browse the repository at this point in the history
Change-Id: I15269722ca3d2654a9dd7a3f8a89ad375dc9bee0
Reviewed-on: https://go-review.googlesource.com/1759
Reviewed-by: Russ Cox <rsc@golang.org>
  • Loading branch information
aclements committed Dec 22, 2014
1 parent 45eaf50 commit 1e93125
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/cmd/ld/ldelf.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 1e93125

Please sign in to comment.