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
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 @@
// 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 @@
__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;