mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-22 13:06:27 +02:00
merge
This commit is contained in:
commit
a89d22bd25
6 changed files with 33 additions and 3 deletions
|
@ -81,6 +81,9 @@ case "$lang" in
|
|||
"nasm" | "asm")
|
||||
bin=nasm
|
||||
;;
|
||||
"nasm64" | "asm64")
|
||||
bin=nasm64
|
||||
;;
|
||||
"node" | "js" | "javascript")
|
||||
bin=node
|
||||
;;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cd /tmp/$2
|
||||
timeout -s KILL 10 nasm -f elf64 -o binary.o code.code
|
||||
timeout -s KILL 10 ld binary.o -o binary
|
||||
timeout -s KILL 10 nasm -f elf32 -o binary.o code.code
|
||||
timeout -s KILL 10 ld -m elf_i386 binary.o -o binary
|
||||
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
|
||||
|
|
4
lxc/executors/nasm64
Executable file
4
lxc/executors/nasm64
Executable file
|
@ -0,0 +1,4 @@
|
|||
cd /tmp/$2
|
||||
timeout -s KILL 10 nasm -f elf64 -o binary.o code.code
|
||||
timeout -s KILL 10 ld -m elf_x86_64 binary.o -o binary
|
||||
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
|
|
@ -23,8 +23,10 @@ echo 'testing js'
|
|||
../execute js test.js
|
||||
echo 'testing kotlin'
|
||||
../execute kotlin test.kt
|
||||
echo 'testing asm'
|
||||
echo 'testing asm 32 bit'
|
||||
../execute asm test.nasm
|
||||
echo 'testing asm 64 bit'
|
||||
../execute asm64 test64.nasm
|
||||
echo 'testing php'
|
||||
../execute php test.php
|
||||
echo 'testing perl'
|
||||
|
|
18
lxc/tests/test64.nasm
Normal file
18
lxc/tests/test64.nasm
Normal file
|
@ -0,0 +1,18 @@
|
|||
SECTION .data
|
||||
good: db "good", 0x0a, 0x0
|
||||
txtlen: equ $ - good
|
||||
|
||||
SECTION .text
|
||||
GLOBAL _start
|
||||
|
||||
_start:
|
||||
;sys_write
|
||||
mov rax, 1
|
||||
mov rdi, 1
|
||||
mov rsi, good
|
||||
mov rdx, txtlen
|
||||
syscall
|
||||
;sys_exit
|
||||
mov rax, 60
|
||||
mov rdi, 0
|
||||
syscall
|
Loading…
Add table
Add a link
Reference in a new issue