[compiler-rt] r177253 - [asan] while generating the description of a global variable, emit the module name in a separate field, thus not duplicating this information if every description. This decreases the binary size (observed up to 3%). https://code.google.com/p/address-sanitizer/issues/detail?id=168 . This changes the asan API version. compiler-rt part, llvm-part will follow

Kostya Serebryany kcc at google.com
Mon Mar 18 01:04:55 PDT 2013


Author: kcc
Date: Mon Mar 18 03:04:55 2013
New Revision: 177253

URL: http://llvm.org/viewvc/llvm-project?rev=177253&view=rev
Log:
[asan] while generating the description of a global variable, emit the module name in a separate field, thus not duplicating this information if every description. This decreases the binary size (observed up to 3%). https://code.google.com/p/address-sanitizer/issues/detail?id=168 . This changes the asan API version. compiler-rt part, llvm-part will follow

Modified:
    compiler-rt/trunk/lib/asan/asan_interface_internal.h
    compiler-rt/trunk/lib/asan/asan_report.cc

Modified: compiler-rt/trunk/lib/asan/asan_interface_internal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface_internal.h?rev=177253&r1=177252&r2=177253&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interface_internal.h (original)
+++ compiler-rt/trunk/lib/asan/asan_interface_internal.h Mon Mar 18 03:04:55 2013
@@ -25,8 +25,8 @@ extern "C" {
   // Everytime the asan ABI changes we also change the version number in this
   // name. Objects build with incompatible asan ABI version
   // will not link with run-time.
-  void __asan_init_v1() SANITIZER_INTERFACE_ATTRIBUTE;
-  #define __asan_init __asan_init_v1
+  void __asan_init_v2() SANITIZER_INTERFACE_ATTRIBUTE;
+  #define __asan_init __asan_init_v2
 
   // This structure describes an instrumented global variable.
   struct __asan_global {
@@ -34,6 +34,7 @@ extern "C" {
     uptr size;               // The original size of the global.
     uptr size_with_redzone;  // The size with the redzone.
     const char *name;        // Name as a C string.
+    const char *module_name; // Module name as a C string.
     uptr has_dynamic_init;   // Non-zero if the global has dynamic initializer.
   };
 

Modified: compiler-rt/trunk/lib/asan/asan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=177253&r1=177252&r2=177253&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Mon Mar 18 03:04:55 2013
@@ -208,8 +208,8 @@ bool DescribeAddressRelativeToGlobal(upt
     // Can it happen?
     Printf("%p is located %zd bytes inside", (void*)addr, addr - g.beg);
   }
-  Printf(" of global variable '%s' (0x%zx) of size %zu\n",
-             g.name, g.beg, g.size);
+  Printf(" of global variable '%s' from '%s' (0x%zx) of size %zu\n",
+             g.name, g.module_name, g.beg, g.size);
   Printf("%s", d.EndLocation());
   PrintGlobalNameIfASCII(g);
   return true;





More information about the llvm-commits mailing list