Also, unexport Machoadddynlib
n=`go test -c crypto/x509 && otool -l x509.test | grep libSystem | wc -l`
Before this CL, n = 3.
After this CL, n = 1.
on my environment.
Change-Id: Ic7b8157435cc85086404860dc6c84eb0aecc5d19
Reviewed-on: https://go-review.googlesource.com/44771
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Avelino <t@avelino.xxx>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
havedynamic = 1
if Headtype == objabi.Hdarwin {
- Machoadddynlib(lib)
+ machoadddynlib(lib)
} else {
dynlib = append(dynlib, lib)
}
}
}
-func Machoadddynlib(lib string) {
+func machoadddynlib(lib string) {
+ if seenlib[lib] || Linkmode == LinkExternal {
+ return
+ }
+ seenlib[lib] = true
+
// Will need to store the library name rounded up
// and 24 bytes of header metadata. If not enough
// space, grab another page of initial space at the