diff options
| author | Cherry Mui <cherryyz@google.com> | 2023-06-14 18:31:44 -0400 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2023-07-27 19:08:00 +0000 |
| commit | 1c10d743eaff174f08e48dff85f64ade0b92425c (patch) | |
| tree | 5dcebac7867d7c32d842061b6218ed6dc098c339 /src | |
| parent | 333c80694c797b5540c959f33c710bc6eba0d141 (diff) | |
| download | go-1c10d743eaff174f08e48dff85f64ade0b92425c.tar.xz | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/link/internal/ld/macho.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/macho.go b/src/cmd/link/internal/ld/macho.go index f48653b910..6722eed4ba 100644 --- a/src/cmd/link/internal/ld/macho.go +++ b/src/cmd/link/internal/ld/macho.go @@ -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) { |
