2014-02-19 16:30:39 +08:00
|
|
|
// This file was generated by gen_asm_instrumentation.sh. Please, do not edit
|
|
|
|
// manually.
|
2014-02-19 17:14:39 +08:00
|
|
|
#ifdef __linux__
|
2014-02-19 16:30:39 +08:00
|
|
|
.section .text
|
|
|
|
#if defined(__x86_64__) || defined(__i386__)
|
|
|
|
.globl __asan_report_store1
|
|
|
|
.globl __asan_report_load1
|
|
|
|
.globl __asan_report_store2
|
|
|
|
.globl __asan_report_load2
|
|
|
|
.globl __asan_report_store4
|
|
|
|
.globl __asan_report_load4
|
|
|
|
.globl __asan_report_store8
|
|
|
|
.globl __asan_report_load8
|
|
|
|
.globl __asan_report_store16
|
|
|
|
.globl __asan_report_load16
|
|
|
|
#endif // defined(__x86_64__) || defined(__i386__)
|
|
|
|
#if defined(__i386__)
|
|
|
|
// Sanitize 1-byte store. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store1
|
|
|
|
.type __sanitizer_sanitize_store1, @function
|
|
|
|
__sanitizer_sanitize_store1:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
movb 0x20000000(%ecx), %cl
|
|
|
|
testb %cl, %cl
|
|
|
|
je .sanitize_store1_done
|
|
|
|
movl %eax, %edx
|
|
|
|
andl $0x7, %edx
|
|
|
|
movsbl %cl, %ecx
|
|
|
|
cmpl %ecx, %edx
|
|
|
|
jl .sanitize_store1_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store1@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store1_done:
|
|
|
|
popfl
|
|
|
|
popl %edx
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 1-byte load. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load1
|
|
|
|
.type __sanitizer_sanitize_load1, @function
|
|
|
|
__sanitizer_sanitize_load1:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
movb 0x20000000(%ecx), %cl
|
|
|
|
testb %cl, %cl
|
|
|
|
je .sanitize_load1_done
|
|
|
|
movl %eax, %edx
|
|
|
|
andl $0x7, %edx
|
|
|
|
movsbl %cl, %ecx
|
|
|
|
cmpl %ecx, %edx
|
|
|
|
jl .sanitize_load1_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load1@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load1_done:
|
|
|
|
popfl
|
|
|
|
popl %edx
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 2-byte store. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store2
|
|
|
|
.type __sanitizer_sanitize_store2, @function
|
|
|
|
__sanitizer_sanitize_store2:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
movb 0x20000000(%ecx), %cl
|
|
|
|
testb %cl, %cl
|
|
|
|
je .sanitize_store2_done
|
|
|
|
movl %eax, %edx
|
|
|
|
andl $0x7, %edx
|
|
|
|
incl %edx
|
|
|
|
movsbl %cl, %ecx
|
|
|
|
cmpl %ecx, %edx
|
|
|
|
jl .sanitize_store2_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store2@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store2_done:
|
|
|
|
popfl
|
|
|
|
popl %edx
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 2-byte load. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load2
|
|
|
|
.type __sanitizer_sanitize_load2, @function
|
|
|
|
__sanitizer_sanitize_load2:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
movb 0x20000000(%ecx), %cl
|
|
|
|
testb %cl, %cl
|
|
|
|
je .sanitize_load2_done
|
|
|
|
movl %eax, %edx
|
|
|
|
andl $0x7, %edx
|
|
|
|
incl %edx
|
|
|
|
movsbl %cl, %ecx
|
|
|
|
cmpl %ecx, %edx
|
|
|
|
jl .sanitize_load2_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load2@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load2_done:
|
|
|
|
popfl
|
|
|
|
popl %edx
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 4-byte store. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store4
|
|
|
|
.type __sanitizer_sanitize_store4, @function
|
|
|
|
__sanitizer_sanitize_store4:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
movb 0x20000000(%ecx), %cl
|
|
|
|
testb %cl, %cl
|
|
|
|
je .sanitize_store4_done
|
|
|
|
movl %eax, %edx
|
|
|
|
andl $0x7, %edx
|
|
|
|
addl $0x3, %edx
|
|
|
|
movsbl %cl, %ecx
|
|
|
|
cmpl %ecx, %edx
|
|
|
|
jl .sanitize_store4_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store4@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store4_done:
|
|
|
|
popfl
|
|
|
|
popl %edx
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 4-byte load. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load4
|
|
|
|
.type __sanitizer_sanitize_load4, @function
|
|
|
|
__sanitizer_sanitize_load4:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
movb 0x20000000(%ecx), %cl
|
|
|
|
testb %cl, %cl
|
|
|
|
je .sanitize_load4_done
|
|
|
|
movl %eax, %edx
|
|
|
|
andl $0x7, %edx
|
|
|
|
addl $0x3, %edx
|
|
|
|
movsbl %cl, %ecx
|
|
|
|
cmpl %ecx, %edx
|
|
|
|
jl .sanitize_load4_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load4@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load4_done:
|
|
|
|
popfl
|
|
|
|
popl %edx
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 8-byte store. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store8
|
|
|
|
.type __sanitizer_sanitize_store8, @function
|
|
|
|
__sanitizer_sanitize_store8:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
cmpb $0x0, 0x20000000(%ecx)
|
|
|
|
je .sanitize_store8_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store8@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store8_done:
|
|
|
|
popfl
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 8-byte load. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load8
|
|
|
|
.type __sanitizer_sanitize_load8, @function
|
|
|
|
__sanitizer_sanitize_load8:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
cmpb $0x0, 0x20000000(%ecx)
|
|
|
|
je .sanitize_load8_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load8@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load8_done:
|
|
|
|
popfl
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 16-byte store. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store16
|
|
|
|
.type __sanitizer_sanitize_store16, @function
|
|
|
|
__sanitizer_sanitize_store16:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
cmpw $0x0, 0x20000000(%ecx)
|
|
|
|
je .sanitize_store16_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store16@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store16_done:
|
|
|
|
popfl
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
// Sanitize 16-byte load. Takes one 4-byte address as an argument on
|
|
|
|
// stack, nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load16
|
|
|
|
.type __sanitizer_sanitize_load16, @function
|
|
|
|
__sanitizer_sanitize_load16:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
pushl %eax
|
|
|
|
pushl %ecx
|
|
|
|
pushfl
|
|
|
|
movl 8(%ebp), %eax
|
|
|
|
movl %eax, %ecx
|
|
|
|
shrl $0x3, %ecx
|
|
|
|
cmpw $0x0, 0x20000000(%ecx)
|
|
|
|
je .sanitize_load16_done
|
|
|
|
pushl %eax
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load16@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load16_done:
|
|
|
|
popfl
|
|
|
|
popl %ecx
|
|
|
|
popl %eax
|
|
|
|
leave
|
|
|
|
ret
|
|
|
|
#endif // defined(__i386__)
|
|
|
|
#if defined(__x86_64__)
|
|
|
|
// Sanitize 1-byte store. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store1
|
|
|
|
.type __sanitizer_sanitize_store1, @function
|
|
|
|
__sanitizer_sanitize_store1:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushq %rcx
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
movb 0x7fff8000(%rax), %al
|
|
|
|
test %al, %al
|
|
|
|
je .sanitize_store1_done
|
|
|
|
movl %edi, %ecx
|
|
|
|
andl $0x7, %ecx
|
|
|
|
movsbl %al, %eax
|
|
|
|
cmpl %eax, %ecx
|
|
|
|
jl .sanitize_store1_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store1@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store1_done:
|
|
|
|
popfq
|
|
|
|
popq %rcx
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 1-byte load. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load1
|
|
|
|
.type __sanitizer_sanitize_load1, @function
|
|
|
|
__sanitizer_sanitize_load1:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushq %rcx
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
movb 0x7fff8000(%rax), %al
|
|
|
|
test %al, %al
|
|
|
|
je .sanitize_load1_done
|
|
|
|
movl %edi, %ecx
|
|
|
|
andl $0x7, %ecx
|
|
|
|
movsbl %al, %eax
|
|
|
|
cmpl %eax, %ecx
|
|
|
|
jl .sanitize_load1_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load1@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load1_done:
|
|
|
|
popfq
|
|
|
|
popq %rcx
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 2-byte store. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store2
|
|
|
|
.type __sanitizer_sanitize_store2, @function
|
|
|
|
__sanitizer_sanitize_store2:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushq %rcx
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
movb 0x7fff8000(%rax), %al
|
|
|
|
test %al, %al
|
|
|
|
je .sanitize_store2_done
|
|
|
|
movl %edi, %ecx
|
|
|
|
andl $0x7, %ecx
|
|
|
|
incl %ecx
|
|
|
|
movsbl %al, %eax
|
|
|
|
cmpl %eax, %ecx
|
|
|
|
jl .sanitize_store2_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store2@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store2_done:
|
|
|
|
popfq
|
|
|
|
popq %rcx
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 2-byte load. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load2
|
|
|
|
.type __sanitizer_sanitize_load2, @function
|
|
|
|
__sanitizer_sanitize_load2:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushq %rcx
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
movb 0x7fff8000(%rax), %al
|
|
|
|
test %al, %al
|
|
|
|
je .sanitize_load2_done
|
|
|
|
movl %edi, %ecx
|
|
|
|
andl $0x7, %ecx
|
|
|
|
incl %ecx
|
|
|
|
movsbl %al, %eax
|
|
|
|
cmpl %eax, %ecx
|
|
|
|
jl .sanitize_load2_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load2@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load2_done:
|
|
|
|
popfq
|
|
|
|
popq %rcx
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 4-byte store. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store4
|
|
|
|
.type __sanitizer_sanitize_store4, @function
|
|
|
|
__sanitizer_sanitize_store4:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushq %rcx
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
movb 0x7fff8000(%rax), %al
|
|
|
|
test %al, %al
|
|
|
|
je .sanitize_store4_done
|
|
|
|
movl %edi, %ecx
|
|
|
|
andl $0x7, %ecx
|
|
|
|
addl $0x3, %ecx
|
|
|
|
movsbl %al, %eax
|
|
|
|
cmpl %eax, %ecx
|
|
|
|
jl .sanitize_store4_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store4@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store4_done:
|
|
|
|
popfq
|
|
|
|
popq %rcx
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 4-byte load. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load4
|
|
|
|
.type __sanitizer_sanitize_load4, @function
|
|
|
|
__sanitizer_sanitize_load4:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushq %rcx
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
movb 0x7fff8000(%rax), %al
|
|
|
|
test %al, %al
|
|
|
|
je .sanitize_load4_done
|
|
|
|
movl %edi, %ecx
|
|
|
|
andl $0x7, %ecx
|
|
|
|
addl $0x3, %ecx
|
|
|
|
movsbl %al, %eax
|
|
|
|
cmpl %eax, %ecx
|
|
|
|
jl .sanitize_load4_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load4@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load4_done:
|
|
|
|
popfq
|
|
|
|
popq %rcx
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 8-byte store. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store8
|
|
|
|
.type __sanitizer_sanitize_store8, @function
|
|
|
|
__sanitizer_sanitize_store8:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
cmpb $0x0, 0x7fff8000(%rax)
|
|
|
|
je .sanitize_store8_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store8@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store8_done:
|
|
|
|
popfq
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 8-byte load. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load8
|
|
|
|
.type __sanitizer_sanitize_load8, @function
|
|
|
|
__sanitizer_sanitize_load8:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
cmpb $0x0, 0x7fff8000(%rax)
|
|
|
|
je .sanitize_load8_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load8@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load8_done:
|
|
|
|
popfq
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 16-byte store. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_store16
|
|
|
|
.type __sanitizer_sanitize_store16, @function
|
|
|
|
__sanitizer_sanitize_store16:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
cmpw $0x0, 0x7fff8000(%rax)
|
|
|
|
je .sanitize_store16_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_store16@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_store16_done:
|
|
|
|
popfq
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
// Sanitize 16-byte load. Takes one 8-byte address as an argument in %rdi,
|
|
|
|
// nothing is returned.
|
|
|
|
.globl __sanitizer_sanitize_load16
|
|
|
|
.type __sanitizer_sanitize_load16, @function
|
|
|
|
__sanitizer_sanitize_load16:
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq -128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
pushq %rax
|
|
|
|
pushfq
|
|
|
|
movq %rdi, %rax
|
|
|
|
shrq $0x3, %rax
|
|
|
|
cmpw $0x0, 0x7fff8000(%rax)
|
|
|
|
je .sanitize_load16_done
|
|
|
|
subq $8, %rsp
|
|
|
|
andq $-16, %rsp
|
|
|
|
cld
|
|
|
|
emms
|
2014-02-20 15:54:29 +08:00
|
|
|
call __asan_report_load16@PLT
|
2014-02-19 16:30:39 +08:00
|
|
|
.sanitize_load16_done:
|
|
|
|
popfq
|
|
|
|
popq %rax
|
2014-05-21 16:21:14 +08:00
|
|
|
leaq 128(%rsp), %rsp
|
2014-02-19 16:30:39 +08:00
|
|
|
ret
|
|
|
|
#endif // defined(__x86_64__)
|
|
|
|
/* We do not need executable stack. */
|
2014-02-19 17:01:14 +08:00
|
|
|
#if defined(__arm__)
|
|
|
|
.section .note.GNU-stack,"",%progbits
|
|
|
|
#else
|
|
|
|
.section .note.GNU-stack,"",@progbits
|
|
|
|
#endif // defined(__arm__)
|
2014-02-19 17:14:39 +08:00
|
|
|
#endif // __linux__
|