[hackers] [scc] [libc] Fix sys assembly generating awk script || Quentin Rameau
commit 5b0a7f2d9d0a0a08a898e3937c780c25be43c032
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Mar 20 17:54:05 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Mar 21 12:07:54 2017 +0100
[libc] Fix sys assembly generating awk script
We forgot to export symbols
diff --git a/libc/src/sys/amd64-sysv-linux/syscall.awk b/libc/src/sys/amd64-sysv-linux/syscall.awk
index 9a4110d..c82bb71 100644
--- a/libc/src/sys/amd64-sysv-linux/syscall.awk
+++ b/libc/src/sys/amd64-sysv-linux/syscall.awk
_AT_@ -1,4 +1,12 @@
+# This job is very easy because app and kernel ABI are identical
+# until the 4th parameter, so we only have to set the syscall
+# number in rax
+
/^#/ {next}
{name=$2 ".s"
- printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name
+ printf ".global %s\n" \
+ "%s:\n" \
+ "\tmovq\t$%d,%%rax\n" \
+ "\tsyscall\n" \
+ "\tret\n", $2, $2, $1 > name
close(name)}
diff --git a/libc/src/sys/qbe-linux/syscall.awk b/libc/src/sys/qbe-linux/syscall.awk
index 80b73bd..c82bb71 100644
--- a/libc/src/sys/qbe-linux/syscall.awk
+++ b/libc/src/sys/qbe-linux/syscall.awk
_AT_@ -4,8 +4,9 @@
/^#/ {next}
{name=$2 ".s"
- printf "%s:\n" \
+ printf ".global %s\n" \
+ "%s:\n" \
"\tmovq\t$%d,%%rax\n" \
"\tsyscall\n" \
- "\tret\n",$2, $1 > name
+ "\tret\n", $2, $2, $1 > name
close(name)}
Received on Tue Mar 21 2017 - 12:08:57 CET
This archive was generated by hypermail 2.3.0
: Tue Mar 21 2017 - 12:12:41 CET