enumerate executable sections only to build checksum
This commit is contained in:
@@ -113,8 +113,7 @@ static int callback(struct dl_phdr_info *dlpi, size_t size, Dl_info *dli)
|
|||||||
const ElfW(Phdr) *sgmt = &dlpi->dlpi_phdr[i];
|
const ElfW(Phdr) *sgmt = &dlpi->dlpi_phdr[i];
|
||||||
|
|
||||||
/* we are interested in the executable LOAD segment */
|
/* we are interested in the executable LOAD segment */
|
||||||
if (sgmt->p_type == PT_LOAD &&
|
if (sgmt->p_type == PT_LOAD && (sgmt->p_flags & PF_X))
|
||||||
(sgmt->p_flags & (PF_X | PF_R)))
|
|
||||||
{
|
{
|
||||||
/* safe begin of segment in dli_fbase */
|
/* safe begin of segment in dli_fbase */
|
||||||
dli->dli_fbase = (void*)sgmt->p_vaddr + dlpi->dlpi_addr;
|
dli->dli_fbase = (void*)sgmt->p_vaddr + dlpi->dlpi_addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user