From f1c3b64a5557fa49eaa0d9c3c8e8d851c754d0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 5 May 2019 00:00:00 +0000 Subject: [PATCH] userland: x86_64 linux hello world make PIE --- userland/arch/x86_64/freestanding/linux/hello.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/userland/arch/x86_64/freestanding/linux/hello.S b/userland/arch/x86_64/freestanding/linux/hello.S index 8fc63b4..9ae517c 100644 --- a/userland/arch/x86_64/freestanding/linux/hello.S +++ b/userland/arch/x86_64/freestanding/linux/hello.S @@ -7,10 +7,10 @@ _start: asm_main_after_prologue: /* write */ - mov $1, %rax /* syscall number */ - mov $1, %rdi /* stdout */ - mov $msg, %rsi /* buffer */ - mov $len, %rdx /* len */ + mov $1, %rax /* syscall number */ + mov $1, %rdi /* stdout */ + lea msg(%rip), %rsi /* buffer */ + mov $len, %rdx /* len */ syscall /* exit */