diff options
| author | Pieter Agten <pieter.agten@fortanix.com> | 2019-12-06 10:54:53 +0100 |
|---|---|---|
| committer | Pieter Agten <pieter.agten@fortanix.com> | 2019-12-06 10:54:53 +0100 |
| commit | f02ffb8b4ca760117875f3b5326e9cff6598dde3 (patch) | |
| tree | f1bad247964b424b1b48f858adaa07ac7ee0081e /src/libstd | |
| parent | 6354d48dc5839878742e7fbf21a120c5c51a946f (diff) | |
| download | rust-f02ffb8b4ca760117875f3b5326e9cff6598dde3.tar.gz rust-f02ffb8b4ca760117875f3b5326e9cff6598dde3.zip | |
Rewrite %rax register before syscall because it is overwritten by the syscall itself
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/sgx/abi/entry.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/sgx/abi/entry.S b/src/libstd/sys/sgx/abi/entry.S index ca2848c61d9..a3e059e8131 100644 --- a/src/libstd/sys/sgx/abi/entry.S +++ b/src/libstd/sys/sgx/abi/entry.S @@ -115,11 +115,11 @@ IMAGE_BASE: .type elf_entry,function elf_entry: /* print error message */ - movq $1,%rax /* write() syscall */ - movq $2,%rdi /* write to stderr (fd 2) */ + movq $2,%rdi /* write to stderr (fd 2) */ lea .Lelf_entry_error_msg(%rip),%rsi movq $.Lelf_entry_error_msg_end-.Lelf_entry_error_msg,%rdx .Lelf_entry_call: + movq $1,%rax /* write() syscall */ syscall test %rax,%rax jle .Lelf_exit /* exit on error */ |
