diff options
Diffstat (limited to 'fs/proc/kcore.c')
-rw-r--r-- | fs/proc/kcore.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index e64ecb9f2720..00282f134336 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -383,8 +383,11 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff) phdr->p_type = PT_LOAD; phdr->p_flags = PF_R|PF_W|PF_X; phdr->p_offset = kc_vaddr_to_offset(m->addr) + dataoff; - phdr->p_vaddr = (size_t)m->addr; - if (m->type == KCORE_RAM || m->type == KCORE_TEXT) + if (m->type == KCORE_REMAP) + phdr->p_vaddr = (size_t)m->vaddr; + else + phdr->p_vaddr = (size_t)m->addr; + if (m->type == KCORE_RAM || m->type == KCORE_TEXT || m->type == KCORE_REMAP) phdr->p_paddr = __pa(m->addr); else phdr->p_paddr = (elf_addr_t)-1; |