Skip to content

Commit

Permalink
fix(vm/compiler): produce position independent code on amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
vsariola committed Oct 15, 2024
1 parent 7470413 commit a72fe6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vm/compiler/x86_macros.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a72fe6f

Please sign in to comment.