Exemple #1
0
// UpdateCalls modifies CallRel instructions, possibly while they are being
// executed.
func (mach X86) UpdateCalls(code gen.OpCoder, l *links.L) {
	funcAddr := l.FinalAddr()
	for _, retAddr := range l.Sites {
		mach.PutUint32(code.Bytes()[retAddr-4:retAddr], uint32(funcAddr-retAddr))
	}
}
Exemple #2
0
// updateBranches8 modifies 8-bit relocations of Jmp and Jcc instructions.
func (mach X86) updateBranches8(code gen.OpCoder, l *links.L) {
	labelAddr := l.FinalAddr()
	for _, retAddr := range l.Sites {
		mach.updateAddr8(code, retAddr, labelAddr-retAddr)
	}
}