This fixes cgo test issue29563 on Darwin.
Updates #29563.
Change-Id: If480078461247cd7c95931ae3ad4ca89736dd550
Reviewed-on: https://go-review.googlesource.com/c/go/+/170015
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-const (
- N_EXT = 0x01
- N_TYPE = 0x1e
- N_STAB = 0xe0
-)
// TODO(crawshaw): de-duplicate these symbols with cmd/internal/ld
const (
indir []uint32
}
+// ldMachoSym.type_
+const (
+ N_EXT = 0x01
+ N_TYPE = 0x1e
+ N_STAB = 0xe0
+)
+
+// ldMachoSym.desc
+const (
+ N_WEAK_REF = 0x40
+ N_WEAK_DEF = 0x80
+)
+
const (
LdMachoCpuVax = 1
LdMachoCpu68000 = 6
if machsym.type_&N_EXT == 0 {
s.Attr |= sym.AttrDuplicateOK
}
+ if machsym.desc&(N_WEAK_REF|N_WEAK_DEF) != 0 {
+ s.Attr |= sym.AttrDuplicateOK
+ }
machsym.sym = s
if machsym.sectnum == 0 { // undefined
continue