dlfcn.cpp revision 5419b9474753d25dff947c7740532f86d130c0be
13b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes/* 23b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * Copyright (C) 2007 The Android Open Source Project 33b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * 43b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * Licensed under the Apache License, Version 2.0 (the "License"); 53b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * you may not use this file except in compliance with the License. 63b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * You may obtain a copy of the License at 73b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * 83b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * http://www.apache.org/licenses/LICENSE-2.0 93b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * 103b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * Unless required by applicable law or agreed to in writing, software 113b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS, 123b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * See the License for the specific language governing permissions and 143b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes * limitations under the License. 153b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes */ 163b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 175419b9474753d25dff947c7740532f86d130c0beElliott Hughes#include "linker.h" 185419b9474753d25dff947c7740532f86d130c0beElliott Hughes 193b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#include <dlfcn.h> 203b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#include <pthread.h> 213b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#include <stdio.h> 225419b9474753d25dff947c7740532f86d130c0beElliott Hughes#include <stdlib.h> 233b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 245419b9474753d25dff947c7740532f86d130c0beElliott Hughes#include <bionic/pthread_internal.h> 255419b9474753d25dff947c7740532f86d130c0beElliott Hughes#include <private/bionic_tls.h> 263b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#include <private/ScopedPthreadMutexLocker.h> 275419b9474753d25dff947c7740532f86d130c0beElliott Hughes#include <private/ThreadLocalBuffer.h> 283b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 293b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes/* This file hijacks the symbols stubbed out in libdl.so. */ 303b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 315419b9474753d25dff947c7740532f86d130c0beElliott Hughesstatic pthread_mutex_t gDlMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER; 323b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 335419b9474753d25dff947c7740532f86d130c0beElliott Hughesstatic const char* __bionic_set_dlerror(char* new_value) { 345419b9474753d25dff947c7740532f86d130c0beElliott Hughes void* tls = const_cast<void*>(__get_tls()); 355419b9474753d25dff947c7740532f86d130c0beElliott Hughes char** dlerror_slot = &reinterpret_cast<char**>(tls)[TLS_SLOT_DLERROR]; 363b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 375419b9474753d25dff947c7740532f86d130c0beElliott Hughes const char* old_value = *dlerror_slot; 385419b9474753d25dff947c7740532f86d130c0beElliott Hughes *dlerror_slot = new_value; 395419b9474753d25dff947c7740532f86d130c0beElliott Hughes return old_value; 405419b9474753d25dff947c7740532f86d130c0beElliott Hughes} 413b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 425419b9474753d25dff947c7740532f86d130c0beElliott Hughesstatic void __bionic_format_dlerror(const char* msg, const char* detail) { 435419b9474753d25dff947c7740532f86d130c0beElliott Hughes char* buffer = __get_thread()->dlerror_buffer; 445419b9474753d25dff947c7740532f86d130c0beElliott Hughes strlcpy(buffer, msg, __BIONIC_DLERROR_BUFFER_SIZE); 453b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes if (detail != NULL) { 465419b9474753d25dff947c7740532f86d130c0beElliott Hughes strlcat(buffer, ": ", __BIONIC_DLERROR_BUFFER_SIZE); 475419b9474753d25dff947c7740532f86d130c0beElliott Hughes strlcat(buffer, detail, __BIONIC_DLERROR_BUFFER_SIZE); 483b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 495419b9474753d25dff947c7740532f86d130c0beElliott Hughes 505419b9474753d25dff947c7740532f86d130c0beElliott Hughes __bionic_set_dlerror(buffer); 515419b9474753d25dff947c7740532f86d130c0beElliott Hughes} 525419b9474753d25dff947c7740532f86d130c0beElliott Hughes 535419b9474753d25dff947c7740532f86d130c0beElliott Hughesconst char* dlerror() { 545419b9474753d25dff947c7740532f86d130c0beElliott Hughes const char* old_value = __bionic_set_dlerror(NULL); 555419b9474753d25dff947c7740532f86d130c0beElliott Hughes return old_value; 563b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes} 573b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 585419b9474753d25dff947c7740532f86d130c0beElliott Hughesvoid* dlopen(const char* filename, int flag) { 5922d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes ScopedPthreadMutexLocker locker(&gDlMutex); 603b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes soinfo* result = find_library(filename); 613b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes if (result == NULL) { 625419b9474753d25dff947c7740532f86d130c0beElliott Hughes __bionic_format_dlerror("dlopen failed", linker_get_error()); 633b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return NULL; 643b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 653b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes soinfo_call_constructors(result); 663b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes result->refcount++; 673b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return result; 683b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes} 693b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 703b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughesvoid* dlsym(void* handle, const char* symbol) { 7122d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes ScopedPthreadMutexLocker locker(&gDlMutex); 723b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 735419b9474753d25dff947c7740532f86d130c0beElliott Hughes if (handle == NULL) { 745419b9474753d25dff947c7740532f86d130c0beElliott Hughes __bionic_format_dlerror("dlsym library handle is null", NULL); 753b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return NULL; 763b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 775419b9474753d25dff947c7740532f86d130c0beElliott Hughes if (symbol == NULL) { 785419b9474753d25dff947c7740532f86d130c0beElliott Hughes __bionic_format_dlerror("dlsym symbol name is null", NULL); 793b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return NULL; 803b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 813b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 823b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes soinfo* found = NULL; 833b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes Elf32_Sym* sym = NULL; 843b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes if (handle == RTLD_DEFAULT) { 853b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes sym = lookup(symbol, &found, NULL); 863b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } else if (handle == RTLD_NEXT) { 873b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes void* ret_addr = __builtin_return_address(0); 883b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes soinfo* si = find_containing_library(ret_addr); 893b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 903b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes sym = NULL; 913b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes if (si && si->next) { 923b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes sym = lookup(symbol, &found, si->next); 933b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 943b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } else { 953b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes found = (soinfo*) handle; 963b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes sym = soinfo_lookup(found, symbol); 973b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 983b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 995419b9474753d25dff947c7740532f86d130c0beElliott Hughes if (sym != NULL) { 1003b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes unsigned bind = ELF32_ST_BIND(sym->st_info); 1013b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1025419b9474753d25dff947c7740532f86d130c0beElliott Hughes if (bind == STB_GLOBAL && sym->st_shndx != 0) { 1033b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes unsigned ret = sym->st_value + found->load_bias; 1043b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return (void*) ret; 1053b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 1063b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1075419b9474753d25dff947c7740532f86d130c0beElliott Hughes __bionic_format_dlerror("symbol found but not global", symbol); 1083b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return NULL; 1093b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } else { 1105419b9474753d25dff947c7740532f86d130c0beElliott Hughes __bionic_format_dlerror("undefined symbol", symbol); 1113b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return NULL; 1123b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 1133b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes} 1143b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1153b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughesint dladdr(const void* addr, Dl_info* info) { 11622d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes ScopedPthreadMutexLocker locker(&gDlMutex); 1173b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1183b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // Determine if this address can be found in any library currently mapped. 1193b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes soinfo* si = find_containing_library(addr); 1203b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes if (si == NULL) { 1213b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return 0; 1223b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 1233b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1243b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes memset(info, 0, sizeof(Dl_info)); 1253b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1263b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes info->dli_fname = si->name; 1273b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // Address at which the shared object is loaded. 1283b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes info->dli_fbase = (void*) si->base; 1293b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1303b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // Determine if any symbol in the library contains the specified address. 1313b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes Elf32_Sym *sym = soinfo_find_symbol(si, addr); 1323b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes if (sym != NULL) { 1333b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes info->dli_sname = si->strtab + sym->st_name; 1343b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes info->dli_saddr = (void*)(si->load_bias + sym->st_value); 1353b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes } 1363b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1373b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return 1; 1383b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes} 1393b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1403b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughesint dlclose(void* handle) { 14122d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes ScopedPthreadMutexLocker locker(&gDlMutex); 1423b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes return soinfo_unload((soinfo*) handle); 1433b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes} 1443b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1453b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#if defined(ANDROID_ARM_LINKER) 1463b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes// 0000000 00011111 111112 22222222 2333333 333344444444445555555 1473b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes// 0123456 78901234 567890 12345678 9012345 678901234567890123456 1483b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#define ANDROID_LIBDL_STRTAB \ 1493b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0dl_unwind_find_exidx\0" 1503b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1513b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER) 1523b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes// 0000000 00011111 111112 22222222 2333333 3333444444444455 1533b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes// 0123456 78901234 567890 12345678 9012345 6789012345678901 1543b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#define ANDROID_LIBDL_STRTAB \ 1553b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0dl_iterate_phdr\0" 1563b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#else 1573b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#error Unsupported architecture. Only ARM, MIPS, and x86 are presently supported. 1583b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#endif 1593b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1603b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes// name_offset: starting index of the name in libdl_info.strtab 1613b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#define ELF32_SYM_INITIALIZER(name_offset, value, shndx) \ 1623b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes { name_offset, \ 1633b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes reinterpret_cast<Elf32_Addr>(reinterpret_cast<void*>(value)), \ 1643b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes /* st_size */ 0, \ 1653b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes (shndx == 0) ? 0 : (STB_GLOBAL << 4), \ 1663b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes /* st_other */ 0, \ 1673b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes shndx } 1683b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 1695419b9474753d25dff947c7740532f86d130c0beElliott Hughesstatic Elf32_Sym gLibDlSymtab[] = { 1703b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // Total length of libdl_info.strtab, including trailing 0. 1713b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // This is actually the STH_UNDEF entry. Technically, it's 1723b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // supposed to have st_name == 0, but instead, it points to an index 1733b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes // in the strtab with a \0 to make iterating through the symtab easier. 1743b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER(sizeof(ANDROID_LIBDL_STRTAB) - 1, NULL, 0), 1753b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER( 0, &dlopen, 1), 1763b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER( 7, &dlclose, 1), 1773b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER(15, &dlsym, 1), 1783b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER(21, &dlerror, 1), 1793b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER(29, &dladdr, 1), 1803b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#if defined(ANDROID_ARM_LINKER) 1813b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER(36, &dl_unwind_find_exidx, 1), 1823b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER) 1833b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ELF32_SYM_INITIALIZER(36, &dl_iterate_phdr, 1), 1843b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#endif 1853b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes}; 1863b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 18722d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// Fake out a hash table with a single bucket. 18822d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// A search of the hash table will look through 1895419b9474753d25dff947c7740532f86d130c0beElliott Hughes// gLibDlSymtab starting with index [1], then 1905419b9474753d25dff947c7740532f86d130c0beElliott Hughes// use gLibDlChains to find the next index to 1915419b9474753d25dff947c7740532f86d130c0beElliott Hughes// look at. gLibDlChains should be set up to 1925419b9474753d25dff947c7740532f86d130c0beElliott Hughes// walk through every element in gLibDlSymtab, 19322d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// and then end with 0 (sentinel value). 19422d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// 1955419b9474753d25dff947c7740532f86d130c0beElliott Hughes// That is, gLibDlChains should look like 19622d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// { 0, 2, 3, ... N, 0 } where N is the number 1975419b9474753d25dff947c7740532f86d130c0beElliott Hughes// of actual symbols, or nelems(gLibDlSymtab)-1 1985419b9474753d25dff947c7740532f86d130c0beElliott Hughes// (since the first element of gLibDlSymtab is not 19922d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// a real symbol). 20022d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// 20122d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// (see soinfo_elf_lookup()) 20222d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// 20322d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// Note that adding any new symbols here requires 20422d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// stubbing them out in libdl. 2055419b9474753d25dff947c7740532f86d130c0beElliott Hughesstatic unsigned gLibDlBuckets[1] = { 1 }; 2065419b9474753d25dff947c7740532f86d130c0beElliott Hughesstatic unsigned gLibDlChains[7] = { 0, 2, 3, 4, 5, 6, 0 }; 2073b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 20822d629211d72adaf46f3fc48f59540f8e5798b1eElliott Hughes// This is used by the dynamic linker. Every process gets these symbols for free. 2093b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughessoinfo libdl_info = { 2103b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes name: "libdl.so", 2113b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2123b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes phdr: 0, phnum: 0, 2133b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes entry: 0, base: 0, size: 0, 2143b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes unused: 0, dynamic: 0, unused2: 0, unused3: 0, 2153b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes next: 0, 2163b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2173b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes flags: FLAG_LINKED, 2183b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2193b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes strtab: ANDROID_LIBDL_STRTAB, 2205419b9474753d25dff947c7740532f86d130c0beElliott Hughes symtab: gLibDlSymtab, 2213b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2223b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes nbucket: 1, 2233b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes nchain: 7, 2245419b9474753d25dff947c7740532f86d130c0beElliott Hughes bucket: gLibDlBuckets, 2255419b9474753d25dff947c7740532f86d130c0beElliott Hughes chain: gLibDlChains, 2263b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2273b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes plt_got: 0, plt_rel: 0, plt_rel_count: 0, rel: 0, rel_count: 0, 2283b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes preinit_array: 0, preinit_array_count: 0, init_array: 0, init_array_count: 0, 2293b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes fini_array: 0, fini_array_count: 0, init_func: 0, fini_func: 0, 2303b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2313b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#if defined(ANDROID_ARM_LINKER) 2323b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes ARM_exidx: 0, ARM_exidx_count: 0, 2333b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#elif defined(ANDROID_MIPS_LINKER) 2343b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes mips_symtabno: 0, mips_local_gotno: 0, mips_gotsym: 0, 2353b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes#endif 2363b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes 2373b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes refcount: 0, 2383b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes { l_addr: 0, l_name: 0, l_ld: 0, l_next: 0, l_prev: 0, }, 2393b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes constructors_called: 0, load_bias: 0, has_text_relocations: 0, 2403b297c40794b23d50cb5240f9b03f6ef25fd98dbElliott Hughes}; 241