diff options
author | Carlos O'Donell <carlos@redhat.com> | 2016-09-29 21:54:31 -0400 |
---|---|---|
committer | Carlos O'Donell <carlos@redhat.com> | 2016-09-30 01:36:56 -0400 |
commit | d61ef7352b0026d9eeaf457dbfbb2e3fd8401e92 (patch) | |
tree | 798532132a35db0935de8cff3f10e8642e3457bb /elf/dl-addr.c | |
parent | 29cb9293326a27576965a40d50a898ee660dff81 (diff) | |
download | glibc-d61ef7352b0026d9eeaf457dbfbb2e3fd8401e92.tar.gz glibc-d61ef7352b0026d9eeaf457dbfbb2e3fd8401e92.tar.xz glibc-d61ef7352b0026d9eeaf457dbfbb2e3fd8401e92.zip |
Bug 20292 - Simplify and test _dl_addr_inside_object
The function _dl_addr_inside_object is simplified by removing the conditional 'reladdr - l->l_phdr[n].p_vaddr >= 0' which is always true. The function is refactored into it's own object file and a unit test added to verify the correct behaviour of the function.
Diffstat (limited to 'elf/dl-addr.c')
-rw-r--r-- | elf/dl-addr.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c index 1b16a58ced..045e746680 100644 --- a/elf/dl-addr.c +++ b/elf/dl-addr.c @@ -144,19 +144,3 @@ _dl_addr (const void *address, Dl_info *info, return result; } libc_hidden_def (_dl_addr) - -/* Return non-zero if ADDR lies within one of L's segments. */ -int -internal_function -_dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr) -{ - int n = l->l_phnum; - const ElfW(Addr) reladdr = addr - l->l_addr; - - while (--n >= 0) - if (l->l_phdr[n].p_type == PT_LOAD - && reladdr - l->l_phdr[n].p_vaddr >= 0 - && reladdr - l->l_phdr[n].p_vaddr < l->l_phdr[n].p_memsz) - return 1; - return 0; -} |