mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-25 18:00:37 -04:00
fix(vm/compiler): produce position independent code on amd64
This commit is contained in:
parent
7ff3c942cb
commit
6ba595e7ff
@ -402,9 +402,9 @@ func (p *X86Macros) Prepare(value string, regs ...string) (string, error) {
|
||||
if len(regs) > 1 {
|
||||
return "", fmt.Errorf("macro Prepare cannot accept more than one register parameter")
|
||||
} else if len(regs) > 0 {
|
||||
return fmt.Sprintf("\nmov r9, qword %v\nlea r9, [r9 + %v]", value, regs[0]), nil
|
||||
return fmt.Sprintf("\nlea r9, [rel %v]\nlea r9, [r9 + %v]", value, regs[0]), nil
|
||||
}
|
||||
return fmt.Sprintf("\nmov r9, qword %v", value), nil
|
||||
return fmt.Sprintf("\nlea r9, [rel %v]", value), nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user