]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: clean up nested if when loading bind local syms
authorAustin Clements <austin@google.com>
Thu, 18 Dec 2014 20:28:58 +0000 (15:28 -0500)
committerAustin Clements <austin@google.com>
Mon, 22 Dec 2014 20:02:16 +0000 (20:02 +0000)
Change-Id: I15269722ca3d2654a9dd7a3f8a89ad375dc9bee0
Reviewed-on: https://go-review.googlesource.com/1759
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/ld/ldelf.c

index 243c8d8078321f63616191ba8142de1be4d3fb75..28d470bc3cb505eda47a170d7b4e55dfc630224c 100644 (file)
@@ -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) {