summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2019-07-31 12:32:57 (GMT)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2019-07-31 12:32:57 (GMT)
commitd36f57952934eaf54f3d3f3257e650cae6e47928 (patch)
treebac6a8d0fa1cde75ae604ca1148f067159dac871
parentfbb6bd2376d32c404762b47bb231e436ed2af2cb (diff)
downloadcoreclr-sandbox/ches01/asan_amd64_intel_syntax.zip
coreclr-sandbox/ches01/asan_amd64_intel_syntax.tar.gz
coreclr-sandbox/ches01/asan_amd64_intel_syntax.tar.bz2
Change tizenasanenv.S syntax (AT&T -> intel) for AMD64sandbox/ches01/asan_amd64_intel_syntax
Change-Id: Ia01f41c422ba2954297594906017c66caaabf4ef Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
-rw-r--r--src/vm/amd64/tizenasanenv.S106
1 files changed, 54 insertions, 52 deletions
diff --git a/src/vm/amd64/tizenasanenv.S b/src/vm/amd64/tizenasanenv.S
index 939b75a..e198c9f 100644
--- a/src/vm/amd64/tizenasanenv.S
+++ b/src/vm/amd64/tizenasanenv.S
@@ -1,42 +1,44 @@
+.intel_syntax noprefix
+
RETADDR_OFFSET=8*15
.macro PUSH_REGS
- push %rdi # 0, arg0
- push %rsi # 1, arg1
- push %rdx # 2, arg2
- push %rcx # 3, arg3
- push %r8 # 4, arg4
- push %r9 # 5, arg5
- push %r10 # 6, ...
- push %r11 # 7, temprory reg
- push %rax # 8
-
- push %rbp
- push %rbx
- push %r15
- push %r14
- push %r13
- push %r12
+ push rdi # 0, arg0
+ push rsi # 1, arg1
+ push rdx # 2, arg2
+ push rcx # 3, arg3
+ push r8 # 4, arg4
+ push r9 # 5, arg5
+ push r10 # 6, ...
+ push r11 # 7, temprory reg
+ push rax # 8
+
+ push rbp
+ push rbx
+ push r15
+ push r14
+ push r13
+ push r12
.endm
.macro POP_REGS
- pop %r12
- pop %r13
- pop %r14
- pop %r15
- pop %rbx
- pop %rbp
-
-
- pop %rax
- pop %r11
- pop %r10
- pop %r9
- pop %r8
- pop %rcx
- pop %rdx
- pop %rsi
- pop %rdi
+ pop r12
+ pop r13
+ pop r14
+ pop r15
+ pop rbx
+ pop rbp
+
+
+ pop rax
+ pop r11
+ pop r10
+ pop r9
+ pop r8
+ pop rcx
+ pop rdx
+ pop rsi
+ pop rdi
.endm
@@ -62,30 +64,30 @@ entryPointer:
PUSH_REGS
// Save the return address and call 'pre handler'
- mov RETADDR_OFFSET(%rsp), %rdi // rdi: get return address
- call *pushAddr(%rip) // save the return address
+ mov rdi, [rsp + RETADDR_OFFSET] // rdi: get return address
+ call [rip + pushAddr] // save the return address
// Change the return address
call next
next:
- pop %rax // rax: get current rip
- add $(postLabel - next), %rax // rax: add offset to 'postLabel'
- mov %rax, RETADDR_OFFSET(%rsp) // change the return address
+ pop rax // rax: get current rip
+ add rax, postLabel - next // rax: add offset to 'postLabel'
+ mov [rsp + RETADDR_OFFSET], rax // change the return address
// Restore context
POP_REGS
// Call original function
- jmp *target(%rip)
+ jmp [rip + target]
postLabel:
// Save context
PUSH_REGS
// Get the return address and call 'post handler'
- add $8, %rsp // align stack
- call *popAddr(%rip) // rax: get the return address
- sub $8, %rsp // restore stack
- mov %rax, RETADDR_OFFSET(%rsp) // restore the return address
+ add rsp, 8 // align stack
+ call [rip + popAddr] // rax: get the return address
+ sub rsp, 8 // restore stack
+ mov [rsp + RETADDR_OFFSET], rax // restore the return address
// Restore context
POP_REGS
@@ -116,30 +118,30 @@ entryPointerJmp:
PUSH_REGS
// Save the return address and call 'pre handler'
- mov RETADDR_OFFSET(%rsp), %rdi // rdi: get return address
- call *pushAddrJmp(%rip) // save the return address
+ mov rdi, [rsp + RETADDR_OFFSET] // rdi: get return address
+ call [rip + pushAddrJmp] // save the return address
// Change the return address
call nextJmp
nextJmp:
- pop %rax // rax: get current rip
- add $(postLabelJmp - nextJmp), %rax // rax: add offset to 'postLabelJmp'
- mov %rax, RETADDR_OFFSET(%rsp) // change the return address
+ pop rax // rax: get current rip
+ add rax, postLabelJmp - nextJmp // rax: add offset to 'postLabelJmp'
+ mov [rsp + RETADDR_OFFSET], rax // change the return address
// Restore context
POP_REGS
// Call original function
- jmp *targetJmp(%rip)
+ jmp [rip + targetJmp]
postLabelJmp:
- sub $8, %rsp // add space for the return addr
+ sub rsp, 8 // add space for the return addr
// Save context
PUSH_REGS
// Get the return address and call 'post handler'
- call *popAddrJmp(%rip) // rax: get the return address
- mov %rax, RETADDR_OFFSET(%rsp) // restore the return address
+ call [rip + popAddrJmp] // rax: get the return address
+ mov [rsp + RETADDR_OFFSET], rax // restore the return address
// Restore context
POP_REGS