Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rjbell4
glibc
glibc-2.5-dladdr.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File glibc-2.5-dladdr.diff of Package glibc
elf/dl-addr.c : (_dl_addr) : Ensure the addres lies in one of the segments loaded for a lib. Sometimes, an entirely unrelated map (say libB) can be allocated in between the mapped segments of a lib (say libA). So, in these cases the _dl_addr for an address within libB, would return libA as the result. We fix this by ensuring that the address falls *IN ANY* of the loaded segments. Index: glibc-2.5/elf/dl-addr.c =================================================================== --- elf/dl-addr.c 2006-08-27 15:49:04.000000000 -0700 +++ elf/dl-addr.c 2007-02-27 15:34:27.000000000 -0800 @@ -28,6 +28,7 @@ struct link_map **mapp, const ElfW(Sym) **symbolp) { const ElfW(Addr) addr = DL_LOOKUP_ADDRESS (address); + int result = 0; /* Protect against concurrent loads and unloads. */ __rtld_lock_lock_recursive (GL(dl_load_lock)); @@ -39,24 +40,26 @@ if (addr >= l->l_map_start && addr < l->l_map_end) { /* We know ADDRESS lies within L if in any shared object. - Make sure it isn't past the end of L's segments. */ - size_t n = l->l_phnum; - if (n > 0) + Make sure it lies within one of L's segments. */ + int n = l->l_phnum; + while (--n >= 0) { - do - --n; - while (l->l_phdr[n].p_type != PT_LOAD); - if (addr >= (l->l_addr + - l->l_phdr[n].p_vaddr + l->l_phdr[n].p_memsz)) - /* Off the end of the highest-addressed shared object. */ + if (l->l_phdr[n].p_type != PT_LOAD) continue; + if ((addr >= l->l_addr + + l->l_phdr[n].p_vaddr) && + (addr < l->l_addr + + l->l_phdr[n].p_vaddr + l->l_phdr[n].p_memsz)) + { + match = l; + goto found_match; + } } - match = l; - break; } - int result = 0; +found_match: + if (match != NULL) { /* Now we know what object the address lies in. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor