[PATCH] make asan work with 7fff8000 offset and prelink

Kostya Serebryany kcc at google.com
Fri Feb 15 02:59:11 PST 2013


kcc added you to the CC list for the revision "make asan work with 7fff8000 offset and prelink".

Hi samsonov,

When prelink is installed in the system, prelink-ed
libraries map between  0x003000000000 and 0x004000000000 thus occupying the shadow Gap, 
so we need so split the address space even further, like this: 
// || `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||
// || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
// || `[0x004000000000, 0x02008fff6fff]` || ShadowGap3 ||
// || `[0x003000000000, 0x003fffffffff]` || MidMem     ||
// || `[0x00087fff8000, 0x002fffffffff]` || ShadowGap2 ||
// || `[0x00067fff8000, 0x00087fff7fff]` || MidShadow  ||
// || `[0x00008fff7000, 0x00067fff7fff]` || ShadowGap  ||
// || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||
// || `[0x000000000000, 0x00007fff7fff]` || LowMem     ||

Do it only if necessary. 

Also added a bit of profiling code to make sure that the 
mapping code is efficient.

Added a lit test to simulate prelink-ed libraries. 
Unfortunately, this test does not work with binutils-gold linker.
If gold is the default linker the test silently passes.

Also replaced 
   __has_feature(address_sanitizer)
with 
 __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
in two places. 



http://llvm-reviews.chandlerc.com/D411

Files:
  include/sanitizer/asan_interface.h
  lib/asan/lit_tests/Linux/asan_prelink_test.cc
  lib/asan/asan_mapping.h
  lib/asan/asan_rtl.cc
  lib/asan/asan_internal.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D411.3.patch
Type: text/x-patch
Size: 15147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130215/8699e35b/attachment.bin>


More information about the llvm-commits mailing list