1
0
mirror of https://github.com/golang/go synced 2024-11-23 07:40:04 -07:00

cmd/link: sort HOSTOBJ and UNDEFEXT symbols with undefined symbols in Mach-O symbol table

HOSTOBJ and UNDEFEXT symbols are actually not defined in the
current translation unit. So put them as undefined symbols, along
with DYNIMPORT.

For #61229.

Change-Id: I1112ca928cdc401bac45adaa3f88b19422813960
Reviewed-on: https://go-review.googlesource.com/c/go/+/503539
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Mui 2023-06-14 18:31:44 -04:00
parent 333c80694c
commit 1c10d743ea

View File

@ -877,7 +877,7 @@ func asmbMacho(ctxt *Link) {
}
func symkind(ldr *loader.Loader, s loader.Sym) int {
if ldr.SymType(s) == sym.SDYNIMPORT {
if t := ldr.SymType(s); t == sym.SDYNIMPORT || t == sym.SHOSTOBJ || t == sym.SUNDEFEXT {
return SymKindUndef
}
if ldr.AttrCgoExport(s) {