Reformatting

No functional changes.

Change-Id: If71775e5fc207e91ebd31ba3c5f9d2c13dc8dada
This commit is contained in:
Dmitriy Ivanov 2014-09-12 09:43:13 -07:00
parent 8d8a789c49
commit 6abf624d12

View File

@ -88,7 +88,7 @@ static LinkerAllocator<LinkedListEntry<soinfo>> g_soinfo_links_allocator;
static soinfo* solist;
static soinfo* sonext;
static soinfo* somain; /* main process, always the one after libdl_info */
static soinfo* somain; // main process, always the one after libdl_info
static const char* const kDefaultLdPaths[] = {
#if defined(__LP64__)
@ -182,10 +182,8 @@ size_t linker_get_error_buffer_size() {
return sizeof(__linker_dl_err_buf);
}
/*
* This function is an empty stub where GDB locates a breakpoint to get notified
* about linker activity.
*/
// This function is an empty stub where GDB locates a breakpoint to get notified
// about linker activity.
extern "C" void __attribute__((noinline)) __attribute__((visibility("default"))) rtld_db_dlactivity();
static pthread_mutex_t g__r_debug_mutex = PTHREAD_MUTEX_INITIALIZER;
@ -199,11 +197,10 @@ static void insert_soinfo_into_debug_map(soinfo* info) {
map->l_name = reinterpret_cast<char*>(info->name);
map->l_ld = info->dynamic;
/* Stick the new library at the end of the list.
* gdb tends to care more about libc than it does
* about leaf libraries, and ordering it this way
* reduces the back-and-forth over the wire.
*/
// Stick the new library at the end of the list.
// gdb tends to care more about libc than it does
// about leaf libraries, and ordering it this way
// reduces the back-and-forth over the wire.
if (r_debug_tail) {
r_debug_tail->l_next = map;
map->l_prev = r_debug_tail;
@ -314,12 +311,13 @@ static void soinfo_free(soinfo* si) {
TRACE("name %s: freeing soinfo @ %p", si->name, si);
for (trav = solist; trav != nullptr; trav = trav->next) {
if (trav == si)
if (trav == si) {
break;
}
prev = trav;
}
if (trav == nullptr) {
/* si was not in solist */
// si was not in solist
DL_ERR("name \"%s\" is not in solist!", si->name);
return;
}
@ -327,9 +325,8 @@ static void soinfo_free(soinfo* si) {
// clear links to/from si
si->remove_all_links();
/* prev will never be null, because the first entry in solist is
always the static libdl_info.
*/
// prev will never be null, because the first entry in solist is
// always the static libdl_info.
prev->next = si->next;
if (si == sonext) {
sonext = prev;
@ -377,15 +374,14 @@ static void parse_LD_PRELOAD(const char* path) {
#if defined(__arm__)
/* For a given PC, find the .so that it belongs to.
* Returns the base address of the .ARM.exidx section
* for that .so, and the number of 8-byte entries
* in that section (via *pcount).
*
* Intended to be called by libc's __gnu_Unwind_Find_exidx().
*
* This function is exposed via dlfcn.cpp and libdl.so.
*/
// For a given PC, find the .so that it belongs to.
// Returns the base address of the .ARM.exidx section
// for that .so, and the number of 8-byte entries
// in that section (via *pcount).
//
// Intended to be called by libc's __gnu_Unwind_Find_exidx().
//
// This function is exposed via dlfcn.cpp and libdl.so.
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
unsigned addr = (unsigned)pc;
@ -401,8 +397,8 @@ _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
#endif
/* Here, we only have to provide a callback to iterate across all the
* loaded libraries. gcc_eh does the rest. */
// Here, we only have to provide a callback to iterate across all the
// loaded libraries. gcc_eh does the rest.
int dl_iterate_phdr(int (*cb)(dl_phdr_info* info, size_t size, void* data), void* data) {
int rv = 0;
for (soinfo* si = solist; si != nullptr; si = si->next) {
@ -430,7 +426,7 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name)
ElfW(Sym)* s = symtab + n;
if (strcmp(strtab + s->st_name, name)) continue;
/* only concern ourselves with global and weak symbol definitions */
// only concern ourselves with global and weak symbol definitions
switch (ELF_ST_BIND(s->st_info)) {
case STB_GLOBAL:
case STB_WEAK: