]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: correct Mach-O file flag
authorHiroshi Ioka <hirochachacha@gmail.com>
Sat, 12 Aug 2017 15:19:51 +0000 (00:19 +0900)
committerIan Lance Taylor <iant@golang.org>
Tue, 15 Aug 2017 00:13:10 +0000 (00:13 +0000)
Only set MH_NOUNDEFS if there are no undefined symbols.
Doesn't seem to matter, but may as well do it right.

Change-Id: I6c472e000578346c28cf0e10f24f870e3a0de628
Reviewed-on: https://go-review.googlesource.com/55310
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/macho.go

index 161833f357c005968affc17953799c5b04bd7062..ccdbc54f66d1dfdb67d16320d6c4bef6d505ec8f 100644 (file)
@@ -263,7 +263,11 @@ func machowrite() int {
        }
        Thearch.Lput(uint32(len(load)) + uint32(nseg) + uint32(ndebug))
        Thearch.Lput(uint32(loadsize))
-       Thearch.Lput(MH_NOUNDEFS) /* flags - no undefines */
+       if nkind[SymKindUndef] == 0 {
+               Thearch.Lput(MH_NOUNDEFS) /* flags - no undefines */
+       } else {
+               Thearch.Lput(0) /* flags */
+       }
        if macho64 {
                Thearch.Lput(0) /* reserved */
        }