当前位置: 首页>>代码示例>>Golang>>正文


Golang LSym.Leaf方法代码示例

本文整理汇总了Golang中github.com/TheJumpCloud/rsc/c2go/liblink.LSym.Leaf方法的典型用法代码示例。如果您正苦于以下问题:Golang LSym.Leaf方法的具体用法?Golang LSym.Leaf怎么用?Golang LSym.Leaf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/TheJumpCloud/rsc/c2go/liblink.LSym的用法示例。


在下文中一共展示了LSym.Leaf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: readsym

func readsym(b *bufio.Reader, s *liblink.LSym) {
	if !undef[s] {
		panic("double-def")
	}
	delete(undef, s)
	s.Name = rdstring(b)
	s.Extname = rdstring(b)
	s.Typ = int(rdint(b))
	s.Version = uint32(rdint(b))
	s.Dupok = int(rdint(b))
	s.External = uint8(rdint(b))
	s.Nosplit = uint8(rdint(b))
	s.Reachable = uint8(rdint(b))
	s.Cgoexport = uint8(rdint(b))
	s.Special = uint8(rdint(b))
	s.Stkcheck = uint8(rdint(b))
	s.Hide = uint8(rdint(b))
	s.Leaf = uint8(rdint(b))
	s.Fnptr = uint8(rdint(b))
	s.Seenglobl = uint8(rdint(b))
	s.Onlist = uint8(rdint(b))
	s.Symid = int16(rdint(b))
	s.Dynid = int(rdint(b))
	s.Sig = int(rdint(b))
	s.Plt = int(rdint(b))
	s.Got = int(rdint(b))
	s.Align = int(rdint(b))
	s.Elfsym = int(rdint(b))
	s.Args = int(rdint(b))
	s.Locals = rdint(b)
	s.Value = rdint(b)
	s.Size = rdint(b)
	s.Hash = rdsym(b)
	s.Allsym = rdsym(b)
	s.Next = rdsym(b)
	s.Sub = rdsym(b)
	s.Outer = rdsym(b)
	s.Gotype = rdsym(b)
	s.Reachparent = rdsym(b)
	s.Queue = rdsym(b)
	s.File = rdstring(b)
	s.Dynimplib = rdstring(b)
	s.Dynimpvers = rdstring(b)
	s.Text = rdprog(b)
	s.Etext = rdprog(b)
	n := int(rdint(b))
	if n > 0 {
		s.P = make([]byte, n)
		io.ReadFull(b, s.P)
	}
	s.R = make([]liblink.Reloc, int(rdint(b)))
	for i := range s.R {
		r := &s.R[i]
		r.Off = rdint(b)
		r.Siz = uint8(rdint(b))
		r.Done = uint8(rdint(b))
		r.Typ = int(rdint(b))
		r.Add = rdint(b)
		r.Xadd = rdint(b)
		r.Sym = rdsym(b)
		r.Xsym = rdsym(b)
	}
}
开发者ID:TheJumpCloud,项目名称:rsc,代码行数:63,代码来源:main.go

示例2: addstacksplit


//.........这里部分代码省略.........
			ABLT,
			ABGT,
			ABLE:
			q1 = p.Pcond
			if q1 != nil {
				for q1.As == ANOP {
					q1 = q1.Link
					p.Pcond = q1
				}
			}
			break
		}
		q = p
	}
	for p = cursym.Text; p != nil; p = p.Link {
		o = p.As
		switch o {
		case ATEXT:
			autosize = p.To.Offset + 4
			if autosize <= 4 {
				if cursym.Text.Mark&LEAF != 0 {
					p.To.Offset = -4
					autosize = 0
				}
			}
			if autosize == 0 && cursym.Text.Mark&LEAF == 0 {
				if ctxt.Debugvlog != 0 {
					fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Name)
					liblink.Bflush(ctxt.Bso)
				}
				cursym.Text.Mark |= LEAF
			}
			if cursym.Text.Mark&LEAF != 0 {
				cursym.Leaf = 1
				if autosize == 0 {
					break
				}
			}
			if p.Reg&liblink.NOSPLIT == 0 {
				p = stacksplit(ctxt, p, autosize, bool2int(cursym.Text.Reg&liblink.NEEDCTXT == 0)) // emit split check
			}
			// MOVW.W		R14,$-autosize(SP)
			p = liblink.Appendp(ctxt, p)
			p.As = AMOVW
			p.Scond |= C_WBIT
			p.From.Typ = D_REG
			p.From.Reg = REGLINK
			p.To.Typ = D_OREG
			p.To.Offset = -autosize
			p.To.Reg = REGSP
			p.Spadj = autosize
			if cursym.Text.Reg&liblink.WRAPPER != 0 {
				// g->panicwrap += autosize;
				// MOVW panicwrap_offset(g), R3
				// ADD $autosize, R3
				// MOVW R3 panicwrap_offset(g)
				p = liblink.Appendp(ctxt, p)
				p.As = AMOVW
				p.From.Typ = D_OREG
				p.From.Reg = REGG
				p.From.Offset = 2 * ctxt.Arch.Ptrsize
				p.To.Typ = D_REG
				p.To.Reg = 3
				p = liblink.Appendp(ctxt, p)
				p.As = AADD
				p.From.Typ = D_CONST
开发者ID:TheJumpCloud,项目名称:rsc,代码行数:67,代码来源:obj5.go


注:本文中的github.com/TheJumpCloud/rsc/c2go/liblink.LSym.Leaf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。