[compiler-rt] r201764 - [asan] Do all calls to __asan_report_* through PLT.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Feb 19 23:54:29 PST 2014


Author: eugenis
Date: Thu Feb 20 01:54:29 2014
New Revision: 201764

URL: http://llvm.org/viewvc/llvm-project?rev=201764&view=rev
Log:
[asan] Do all calls to __asan_report_* through PLT.

This matters when runtime is built as a shared library. Even though calling
code is itself part of the same library, these symbols are public and can
(theoretically) be interposed.

It might be better to declare hidden aliases for asan_report_* and call them
directly, but
  (a) they are (noreturn), so performance does not matter, and
  (b) it may be potentially less portable.

Modified:
    compiler-rt/trunk/lib/asan/asan_asm_instrumentation.S

Modified: compiler-rt/trunk/lib/asan/asan_asm_instrumentation.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_asm_instrumentation.S?rev=201764&r1=201763&r2=201764&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_asm_instrumentation.S (original)
+++ compiler-rt/trunk/lib/asan/asan_asm_instrumentation.S Thu Feb 20 01:54:29 2014
@@ -40,7 +40,7 @@ __sanitizer_sanitize_store1:
   pushl %eax
   cld
   emms
-  call __asan_report_store1
+  call __asan_report_store1 at PLT
 .sanitize_store1_done:
   popfl
   popl %edx
@@ -73,7 +73,7 @@ __sanitizer_sanitize_load1:
   pushl %eax
   cld
   emms
-  call __asan_report_load1
+  call __asan_report_load1 at PLT
 .sanitize_load1_done:
   popfl
   popl %edx
@@ -107,7 +107,7 @@ __sanitizer_sanitize_store2:
   pushl %eax
   cld
   emms
-  call __asan_report_store2
+  call __asan_report_store2 at PLT
 .sanitize_store2_done:
   popfl
   popl %edx
@@ -141,7 +141,7 @@ __sanitizer_sanitize_load2:
   pushl %eax
   cld
   emms
-  call __asan_report_load2
+  call __asan_report_load2 at PLT
 .sanitize_load2_done:
   popfl
   popl %edx
@@ -175,7 +175,7 @@ __sanitizer_sanitize_store4:
   pushl %eax
   cld
   emms
-  call __asan_report_store4
+  call __asan_report_store4 at PLT
 .sanitize_store4_done:
   popfl
   popl %edx
@@ -209,7 +209,7 @@ __sanitizer_sanitize_load4:
   pushl %eax
   cld
   emms
-  call __asan_report_load4
+  call __asan_report_load4 at PLT
 .sanitize_load4_done:
   popfl
   popl %edx
@@ -235,7 +235,7 @@ __sanitizer_sanitize_store8:
   pushl %eax
   cld
   emms
-  call __asan_report_store8
+  call __asan_report_store8 at PLT
 .sanitize_store8_done:
   popfl
   popl %ecx
@@ -260,7 +260,7 @@ __sanitizer_sanitize_load8:
   pushl %eax
   cld
   emms
-  call __asan_report_load8
+  call __asan_report_load8 at PLT
 .sanitize_load8_done:
   popfl
   popl %ecx
@@ -285,7 +285,7 @@ __sanitizer_sanitize_store16:
   pushl %eax
   cld
   emms
-  call __asan_report_store16
+  call __asan_report_store16 at PLT
 .sanitize_store16_done:
   popfl
   popl %ecx
@@ -310,7 +310,7 @@ __sanitizer_sanitize_load16:
   pushl %eax
   cld
   emms
-  call __asan_report_load16
+  call __asan_report_load16 at PLT
 .sanitize_load16_done:
   popfl
   popl %ecx
@@ -342,7 +342,7 @@ __sanitizer_sanitize_store1:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_store1
+  call __asan_report_store1 at PLT
 .sanitize_store1_done:
   popfq
   popq %rcx
@@ -372,7 +372,7 @@ __sanitizer_sanitize_load1:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_load1
+  call __asan_report_load1 at PLT
 .sanitize_load1_done:
   popfq
   popq %rcx
@@ -403,7 +403,7 @@ __sanitizer_sanitize_store2:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_store2
+  call __asan_report_store2 at PLT
 .sanitize_store2_done:
   popfq
   popq %rcx
@@ -434,7 +434,7 @@ __sanitizer_sanitize_load2:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_load2
+  call __asan_report_load2 at PLT
 .sanitize_load2_done:
   popfq
   popq %rcx
@@ -465,7 +465,7 @@ __sanitizer_sanitize_store4:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_store4
+  call __asan_report_store4 at PLT
 .sanitize_store4_done:
   popfq
   popq %rcx
@@ -496,7 +496,7 @@ __sanitizer_sanitize_load4:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_load4
+  call __asan_report_load4 at PLT
 .sanitize_load4_done:
   popfq
   popq %rcx
@@ -519,7 +519,7 @@ __sanitizer_sanitize_store8:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_store8
+  call __asan_report_store8 at PLT
 .sanitize_store8_done:
   popfq
   popq %rax
@@ -541,7 +541,7 @@ __sanitizer_sanitize_load8:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_load8
+  call __asan_report_load8 at PLT
 .sanitize_load8_done:
   popfq
   popq %rax
@@ -563,7 +563,7 @@ __sanitizer_sanitize_store16:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_store16
+  call __asan_report_store16 at PLT
 .sanitize_store16_done:
   popfq
   popq %rax
@@ -585,7 +585,7 @@ __sanitizer_sanitize_load16:
   andq $-16, %rsp
   cld
   emms
-  call __asan_report_load16
+  call __asan_report_load16 at PLT
 .sanitize_load16_done:
   popfq
   popq %rax





More information about the llvm-commits mailing list