github.com/bgentry/go@v0.0.0-20150121062915-6cf5a733d54d/src/cmd/link/testdata/autoweak.s (about)

     1  // Copyright 2014 The Go Authors.  All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Test of go.weak symbols.
     6  
     7  TEXT start(SB),7,$0
     8  	MOVQ $autotab(SB),AX
     9  	MOVQ $autoptr(SB),AX
    10  	RET
    11  
    12  // go.weak.sym should resolve to sym, because sym is in the binary.
    13  DATA autotab+0(SB)/8, $go·weak·sym(SB)
    14  DATA autotab+8(SB)/8, $sym(SB)
    15  
    16  // go.weak.missingsym should resolve to 0, because missingsym is not in the binary.
    17  DATA autotab+16(SB)/8, $go·weak·missingsym(SB)
    18  DATA autotab+24(SB)/8, $0
    19  
    20  // go.weak.deadsym should resolve to 0, because deadsym is discarded during dead code removal
    21  DATA autotab+32(SB)/8, $go·weak·deadsym(SB)
    22  DATA autotab+40(SB)/8, $0
    23  
    24  GLOBL autotab(SB), $48
    25  
    26  GLOBL sym(SB), $1
    27  
    28  GLOBL deadsym(SB), $1
    29  
    30  GLOBL autoptr(SB), $0