]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: don't warn about unnamed symbols in .debug_str section
authorIan Lance Taylor <iant@golang.org>
Thu, 5 Nov 2015 02:20:57 +0000 (18:20 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 6 Nov 2015 05:23:30 +0000 (05:23 +0000)
They reportedly occur with LLVM 3.7 on FreeBSD ARM.

Fixes #13139.

Change-Id: Ia7d053a8662696b1984e81fbd1d908c951c35a98
Reviewed-on: https://go-review.googlesource.com/16667
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/link/internal/ld/ldelf.go
src/cmd/link/internal/ld/lib.go

index a321016999e4f4dfd3cf8094e77eb3eb2dbc653a..c088b07e911d9cd6d1a1006acee1c943438d6156 100644 (file)
@@ -765,6 +765,13 @@ func ldelf(f *obj.Biobuf, pkg string, length int64, pn string) {
                        if strings.HasPrefix(sym.name, ".Linfo_string") { // clang does this
                                continue
                        }
+
+                       if sym.name == "" && sym.type_ == 0 && sect.name == ".debug_str" {
+                               // This reportedly happens with clang 3.7 on ARM.
+                               // See issue 13139.
+                               continue
+                       }
+
                        Diag("%s: sym#%d: ignoring %s in section %d (type %d)", pn, i, sym.name, sym.shndx, sym.type_)
                        continue
                }
index f3ca4b8f27231aa1414b52a7140e561e3b6f2781..f0e051173b736c2abb72415b8457da1373f9002e 100644 (file)
@@ -1807,7 +1807,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
        }
 
        for s := Ctxt.Allsym; s != nil; s = s.Allsym {
-               if s.Hide != 0 || (s.Name[0] == '.' && s.Version == 0 && s.Name != ".rathole") {
+               if s.Hide != 0 || ((s.Name == "" || s.Name[0] == '.') && s.Version == 0 && s.Name != ".rathole") {
                        continue
                }
                switch s.Type & obj.SMASK {