diff options
author | Kostya Serebryany <kcc@google.com> | 2012-05-22 13:31:35 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-05-22 13:31:35 +0000 |
commit | 76ac5725a74b7f304803113ec90864ec2da796a4 (patch) | |
tree | a711623754fb2c1271993c0631ba650b18208b61 /lib/asan/asan_linux.cc | |
parent | 6f350e0d1c385189cb94ddde7b288a2533b45b32 (diff) | |
download | compiler-rt-76ac5725a74b7f304803113ec90864ec2da796a4.tar.gz compiler-rt-76ac5725a74b7f304803113ec90864ec2da796a4.tar.bz2 compiler-rt-76ac5725a74b7f304803113ec90864ec2da796a4.tar.xz |
[asan] nuke some old unused code
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157250 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_linux.cc')
-rw-r--r-- | lib/asan/asan_linux.cc | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index 7fa59d81..134f8fda 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -216,8 +216,6 @@ bool AsanProcMaps::Next(uintptr_t *start, uintptr_t *end, return true; } -#if 1 - // Gets the object name and the offset by walking AsanProcMaps. bool AsanProcMaps::GetObjectNameAndOffset(uintptr_t addr, uintptr_t *offset, char filename[], @@ -225,55 +223,6 @@ bool AsanProcMaps::GetObjectNameAndOffset(uintptr_t addr, uintptr_t *offset, return IterateForObjectNameAndOffset(addr, offset, filename, filename_size); } -#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; - uintptr_t offset; - char *filename; - size_t filename_size; -}; - -static int dl_iterate_phdr_callback(struct dl_phdr_info *info, - size_t size, void *raw_data) { - DlIterateData *data = (DlIterateData*)raw_data; - int count = data->count++; - if (info->dlpi_addr > data->addr) - return 0; - if (count == 0) { - // The first item (the main executable) does not have a so name, - // but we can just read it from /proc/self/exe. - size_t path_len = readlink("/proc/self/exe", - data->filename, data->filename_size - 1); - data->filename[path_len] = 0; - } else { - CHECK(info->dlpi_name); - REAL(strncpy)(data->filename, info->dlpi_name, data->filename_size); - } - data->offset = data->addr - info->dlpi_addr; - return 1; -} - -// Gets the object name and the offset using dl_iterate_phdr. -bool AsanProcMaps::GetObjectNameAndOffset(uintptr_t addr, uintptr_t *offset, - char filename[], - size_t filename_size) { - DlIterateData data; - data.count = 0; - data.addr = addr; - data.filename = filename; - data.filename_size = filename_size; - if (dl_iterate_phdr(dl_iterate_phdr_callback, &data)) { - *offset = data.offset; - return true; - } - return false; -} - -#endif // __arm__ - void AsanThread::SetThreadStackTopAndBottom() { if (tid() == 0) { // This is the main thread. Libpthread may not be initialized yet. |