$OpenBSD: patch-src_cmd_link_internal_ld_ldelf_go,v 1.2 2017/09/03 15:42:25 jsing Exp $
Index: src/cmd/link/internal/ld/ldelf.go
--- src/cmd/link/internal/ld/ldelf.go.orig
+++ src/cmd/link/internal/ld/ldelf.go
@@ -9,6 +9,7 @@ import (
 	"fmt"
 	"io"
 	"log"
+	"runtime"
 	"sort"
 	"strings"
 )
@@ -1062,6 +1063,13 @@ func readelfsym(ctxt *Link, elfobj *ElfObj, i int, sym
 				if s != nil && sym.other == 2 {
 					s.Type |= SHIDDEN
 					s.Attr |= AttrDuplicateOK
+				}
+
+				// TODO(jsing): Currently, clang on OpenBSD is generating hidden
+				// __guard_local symbols, which is tripping up the Go linker.
+				// As a workaround, mark the symbol as visible for the time being.
+				if s != nil && runtime.GOOS == "openbsd" && sym.name == "__guard_local" {
+					s.Type &^= SHIDDEN
 				}
 			}
 
