summaryrefslogtreecommitdiffstats
path: root/linker/dlfcn.cpp
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-09-29 19:14:45 -0700
committerDmitriy Ivanov <dimitry@google.com>2014-09-30 14:41:29 -0700
commit6cdeb5234d7f4523fe9d83974f265d80f10512a6 (patch)
treea676112a9293947e7e8c1ecb3c51d8b63036795e /linker/dlfcn.cpp
parent9997daa0ff8f630bee5d3b8eb0ab15a0ba1e5cf6 (diff)
downloadbionic-6cdeb5234d7f4523fe9d83974f265d80f10512a6.zip
bionic-6cdeb5234d7f4523fe9d83974f265d80f10512a6.tar.gz
bionic-6cdeb5234d7f4523fe9d83974f265d80f10512a6.tar.bz2
Fix unused DT entry warnings.
DT_STRSZ Implement strtab boundary checks DT_FLAGS_1 Warn if flags other than DF_1_NOW|DF_1_GLOBAL are set Bug: 17552334 Change-Id: Iaad29cd52f5b2d7d2f785fb351697906dc1617d9
Diffstat (limited to 'linker/dlfcn.cpp')
-rw-r--r--linker/dlfcn.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index c930ce9..98931c7 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -147,7 +147,7 @@ int dladdr(const void* addr, Dl_info* info) {
// Determine if any symbol in the library contains the specified address.
ElfW(Sym)* sym = dladdr_find_symbol(si, addr);
if (sym != nullptr) {
- info->dli_sname = si->strtab + sym->st_name;
+ info->dli_sname = si->get_string(sym->st_name);
info->dli_saddr = reinterpret_cast<void*>(si->resolve_symbol_address(sym));
}
@@ -245,6 +245,7 @@ soinfo* get_libdl_info() {
__libdl_info.bucket = g_libdl_buckets;
__libdl_info.chain = g_libdl_chains;
__libdl_info.ref_count = 1;
+ __libdl_info.strtab_size = sizeof(ANDROID_LIBDL_STRTAB);
}
return &__libdl_info;