rem: if (pheaders->p_memsz!= pheaders->p_filesz) { unsigned A = pheaders->p_vaddr + pheaders->p_memsz; unsigned B = pheaders->p_vaddr + pheaders->p_filesz - 1;  A = PAGE_BASE(A); B = PAGE_BASE(B);
add: if (pheaders->p_memsz != pheaders->p_filesz) { addr_t A = TO_PAGE_SIZE(pheaders->p_vaddr + pheaders->p_memsz); addr_t B = TO_PAGE_SIZE(pheaders->p_vaddr + pheaders->p_filesz);
context: count_regions(char const *buff, int phnum, int phentsize){	int i;	int retval = 0;	struct Elf32_Phdr *pheaders;	for (i = 0; i < phnum; i++) {		pheaders = (struct Elf32_Phdr *)(buff + i * phentsize);		switch (pheaders->p_type) {			case PT_NULL:				/* NOP header */				break;			case PT_LOAD:				retval += 1;				if (pheaders->p_memsz!= pheaders->p_filesz) {					unsigned A = pheaders->p_vaddr + pheaders->p_memsz;					unsigned B = pheaders->p_vaddr + pheaders->p_filesz - 1;					A = PAGE_BASE(A);					B = PAGE_BASE(B);					if (A != B)						retval += 1;				}				break;			case PT_DYNAMIC:				/* will be handled at some other place */				break;			case PT_INTERP:				/* should check here for appropiate interpreter */				break;			case PT_NOTE:				/* unsupported */				break;			case PT_SHLIB:				/* undefined semantics */				break;			case PT_PHDR:				/* we don't use it */				break;			default:				FATAL(true, "unhandled pheader type 0x%lx\n", pheaders[i].p_type);				break;		}	}	return retval;}