diff options
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/lib/asan/Makefile.old | 1 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_linux.cc | 7 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_procmaps.h | 7 |
3 files changed, 9 insertions, 6 deletions
diff --git a/compiler-rt/lib/asan/Makefile.old b/compiler-rt/lib/asan/Makefile.old index ace105b9ed1..9792367e17b 100644 --- a/compiler-rt/lib/asan/Makefile.old +++ b/compiler-rt/lib/asan/Makefile.old @@ -175,6 +175,7 @@ RTL_HDR=asan_allocator.h \ asan_lock.h \ asan_mac.h \ asan_mapping.h \ + asan_procmaps.h \ asan_stack.h \ asan_stats.h \ asan_thread.h \ diff --git a/compiler-rt/lib/asan/asan_linux.cc b/compiler-rt/lib/asan/asan_linux.cc index 14fc3e5fdcd..40f9f94d028 100644 --- a/compiler-rt/lib/asan/asan_linux.cc +++ b/compiler-rt/lib/asan/asan_linux.cc @@ -213,7 +213,7 @@ bool AsanProcMaps::Next(uintptr_t *start, uintptr_t *end, return true; } -#ifdef __arm__ +#if 1 // Gets the object name and the offset by walking AsanProcMaps. bool AsanProcMaps::GetObjectNameAndOffset(uintptr_t addr, uintptr_t *offset, @@ -222,8 +222,9 @@ bool AsanProcMaps::GetObjectNameAndOffset(uintptr_t addr, uintptr_t *offset, return IterateForObjectNameAndOffset(addr, offset, filename, filename_size); } -#else // __arm__ - +#else +// dl_iterate_phdr machinery is not working well for us. +// We either need to fix it or get rid of it. struct DlIterateData { int count; uintptr_t addr; diff --git a/compiler-rt/lib/asan/asan_procmaps.h b/compiler-rt/lib/asan/asan_procmaps.h index 6dd42f9f653..5ae5fb238b6 100644 --- a/compiler-rt/lib/asan/asan_procmaps.h +++ b/compiler-rt/lib/asan/asan_procmaps.h @@ -37,10 +37,11 @@ class AsanProcMaps { char filename[], size_t filename_size) { Reset(); uintptr_t start, end, file_offset; - while (Next(&start, &end, &file_offset, - filename, filename_size)) { + for (int i = 0; Next(&start, &end, &file_offset, filename, filename_size); + i++) { if (addr >= start && addr < end) { - *offset = (addr - start) + file_offset; + // Don't subtract 'start' for the first entry. Don't ask me why. + *offset = (addr - (i ? start : 0)) + file_offset; return true; } } |

