func (p *Parser) symbolReference(a *obj.Addr, name string, prefix rune) {
	// Identifier is a name.
	switch prefix {
	case 0:
		a.Type = obj.TYPE_MEM
	case '$':
		a.Type = obj.TYPE_ADDR
	case '*':
		a.Type = obj.TYPE_INDIR
	}

	// Parse optional <> (indicates a static symbol) or
	// <ABIxxx> (selecting text symbol with specific ABI).
	doIssueError := true
	isStatic, abi := p.symRefAttrs(name, doIssueError)

	if p.peek() == '+' || p.peek() == '-' {
		a.Offset = int64(p.expr())
	}
	if isStatic {
		a.Sym = p.ctxt.LookupStatic(name)
	} else {
		a.Sym = p.ctxt.LookupABI(name, abi)
	}
	if p.peek() == scanner.EOF {
		if prefix == 0 && p.isJump {
			// Symbols without prefix or suffix are jump labels.
			return
		}
		p.errorf("illegal or missing addressing mode for symbol %s", name)
		return
	}
	// Expect (SB), (FP), (PC), or (SP)
	p.get('(')
	reg := p.get(scanner.Ident).String()
	p.get(')')
	p.setPseudoRegister(a, reg, isStatic, prefix)
}
// symbolReference parses a symbol that is known not to be a register.
symbolReference parses a symbol that is known not to be a register.
// symbolReference parses a symbol that is known not to be a register .
func (p *Parser) symbolReference(a *obj.Addr, name string, prefix rune) {
	switch prefix {
	case 0:
		a.Type = obj.TYPE_MEM
	case '$':
		a.Type = obj.TYPE_ADDR
	case '*':
		a.Type = obj.TYPE_INDIR
	}
	doIssueError := true
	isStatic, abi := p.symRefAttrs(name, doIssueError)
	if p.peek() == '+' || p.peek() == '-' {
		a.Offset = int64(p.expr())
	}
	if isStatic {
		a.Sym = p.ctxt.LookupStatic(name)
	} else {
		a.Sym = p.ctxt.LookupABI(name, abi)
	}
	if p.peek() == scanner.EOF {
		if prefix == 0 && p.isJump {
			return
		}
		p.errorf("illegal or missing addressing mode for symbol %s", name)
		return
	}
	p.get('(')
	reg := p.get(scanner.Ident).String()
	p.get(')')
	p.setPseudoRegister(a, reg, isStatic, prefix)
}
func ( p * Parser ) symbolReference ( a * obj . Addr , name string , prefix rune ) { switch prefix { case 0 : a . Type = obj . TYPE_MEM case '$' : a . Type = obj . TYPE_ADDR case '*' : a . Type = obj . TYPE_INDIR } doIssueError := true isStatic , abi := p . symRefAttrs ( name , doIssueError ) if p . peek ( ) == '+' || p . peek ( ) == '-' { a . Offset = int64 ( p . expr ( ) ) } if isStatic { a . Sym = p . ctxt . LookupStatic ( name ) } else { a . Sym = p . ctxt . LookupABI ( name , abi ) } if p . peek ( ) == scanner . EOF { if prefix == 0 && p . isJump { return } p . errorf ( " " , name ) return } p . get ( '(' ) reg := p . get ( scanner . Ident ) . String ( ) p . get ( ')' ) p . setPseudoRegister ( a , reg , isStatic , prefix ) }
symbolReference parses a symbol that is known not to be a register.
symbolReference parses a symbol that is known not to be a register .
// Identifier is a name. // Parse optional <> (indicates a static symbol) or // <ABIxxx> (selecting text symbol with specific ABI). // Symbols without prefix or suffix are jump labels. // Expect (SB), (FP), (PC), or (SP)