1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:14:49 -07:00

cmd/link: don't warn about unnamed symbols in .debug_str section

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>
This commit is contained in:
Ian Lance Taylor 2015-11-04 18:20:57 -08:00
parent e3b615fd6c
commit 26263354a3
2 changed files with 8 additions and 1 deletions

View 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 if strings.HasPrefix(sym.name, ".Linfo_string") { // clang does this
continue 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_) Diag("%s: sym#%d: ignoring %s in section %d (type %d)", pn, i, sym.name, sym.shndx, sym.type_)
continue continue
} }

View 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 { 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 continue
} }
switch s.Type & obj.SMASK { switch s.Type & obj.SMASK {