comparison dynload/dynload_unix.c @ 405:e221473a8217

comment cleanups and clarification
author Tassilo Philipp
date Wed, 07 Apr 2021 18:51:38 +0200
parents c7c180c73dc9
children 61c485f8cc06
comparison
equal deleted inserted replaced
404:524fdca405bf 405:e221473a8217
195 /* compare handles and get name if found; if d->pLib == NULL this will 195 /* compare handles and get name if found; if d->pLib == NULL this will
196 enter info on first iterated object, which is the process itself */ 196 enter info on first iterated object, which is the process itself */
197 if(lib == (void*)d->pLib) { 197 if(lib == (void*)d->pLib) {
198 l = dl_strlen_strcpy(d->sOut, info->dlpi_name, d->bufSize); 198 l = dl_strlen_strcpy(d->sOut, info->dlpi_name, d->bufSize);
199 199
200 /* if dlpi_name is empty, lookup name via dladdr(proc_load_addr, ...) */ 200 /* dlpi_name might be empty for the own process (d->pLib == NULL), so */
201 /* try lookup via dladdr(proc_load_addr, ...) */
201 if(l == 0 && d->pLib == NULL) { 202 if(l == 0 && d->pLib == NULL) {
202 /* dlpi_addr is the reloc base (0 if PIE), find real virtual load addr */ 203 /* dlpi_addr is the reloc base (0 if PIE), find real virtual load addr */
203 void* vladdr = (void*)info->dlpi_addr; 204 void* vladdr = (void*)info->dlpi_addr;
204 int i = 0; 205 int i = 0;
205 for(; i < info->dlpi_phnum; ++i) { 206 for(; i < info->dlpi_phnum; ++i) {