search for: p_paddr

Displaying 20 results from an estimated 48 matches for "p_paddr".

2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...long mem, unsigned long *pgdir_addr, const char *initrd, unsigned long *ird_size, unsigned long *page_offset) @@ -210,7 +227,7 @@ static u32 map_elf(int elf_fd, const Elf continue; verbose("Section %i: size %i addr %p\n", - i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); + i, phdr[i].p_memsz, (void *)(long)phdr[i].p_paddr); /* We map everything private, writable. */ if (phdr[i].p_paddr + phdr[i].p_memsz > mem) errx(1, "Segment %i overlaps end of memory", i); @@ -227,6 +244,77 @@ static u32 map_elf(int elf_fd, const Elf phdr[i].p_offse...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...long mem, unsigned long *pgdir_addr, const char *initrd, unsigned long *ird_size, unsigned long *page_offset) @@ -210,7 +227,7 @@ static u32 map_elf(int elf_fd, const Elf continue; verbose("Section %i: size %i addr %p\n", - i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); + i, phdr[i].p_memsz, (void *)(long)phdr[i].p_paddr); /* We map everything private, writable. */ if (phdr[i].p_paddr + phdr[i].p_memsz > mem) errx(1, "Segment %i overlaps end of memory", i); @@ -227,6 +244,77 @@ static u32 map_elf(int elf_fd, const Elf phdr[i].p_offse...
2007 May 06
1
[PATCH 1/3] lguest: 2.6.21-mm1 update: lguest-remove-unnecessary-gdt-load.patch
Andrew did a great job of merging in the PDA->percpu changes and lguest code for 2.6.21-mm1, but the load_gdt is now unnecessary. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- drivers/lguest/lguest.c | 4 ---- 1 file changed, 4 deletions(-) =================================================================== --- a/drivers/lguest/lguest.c +++ b/drivers/lguest/lguest.c @@
2007 May 06
1
[PATCH 1/3] lguest: 2.6.21-mm1 update: lguest-remove-unnecessary-gdt-load.patch
Andrew did a great job of merging in the PDA->percpu changes and lguest code for 2.6.21-mm1, but the load_gdt is now unnecessary. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- drivers/lguest/lguest.c | 4 ---- 1 file changed, 4 deletions(-) =================================================================== --- a/drivers/lguest/lguest.c +++ b/drivers/lguest/lguest.c @@
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...ments at virtual addresses corresponding + * to their physical addresses (our virtual == guest physical). */ + for (i = 0; i < ehdr->e_phnum; i++) { + if (phdr[i].p_type != PT_LOAD) + continue; + + verbose("Section %i: size %i addr %p\n", + i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); + /* We map everything private, writable. */ + if (phdr[i].p_paddr + phdr[i].p_memsz > mem) + errx(1, "Segment %i overlaps end of memory", i); + + /* We expect linear address space. */ + if (!*page_offset) + *page_offset = phdr[i].p_vaddr - phdr[i].p_paddr; + else if (*page_...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...ments at virtual addresses corresponding + * to their physical addresses (our virtual == guest physical). */ + for (i = 0; i < ehdr->e_phnum; i++) { + if (phdr[i].p_type != PT_LOAD) + continue; + + verbose("Section %i: size %i addr %p\n", + i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); + /* We map everything private, writable. */ + if (phdr[i].p_paddr + phdr[i].p_memsz > mem) + errx(1, "Segment %i overlaps end of memory", i); + + /* We expect linear address space. */ + if (!*page_offset) + *page_offset = phdr[i].p_vaddr - phdr[i].p_paddr; + else if (*page_...
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...+ /* Load 64-bit ELF */ + regs.eip = eh64->e_entry; /* Can be overridden further down... */ + + ph64 = (Elf64_Phdr *) (cptr + eh64->e_phoff); + + for (i = 0; i < eh64->e_phnum; i++) { + if (ph64->p_type == PT_LOAD || ph64->p_type == PT_PHDR) { + /* + * This loads at p_paddr, which matches Grub. However, if + * e_entry falls within the p_vaddr range of this PHDR, then + * adjust it to match the p_paddr range... this is how Grub + * behaves, so it's by definition correct (it doesn't have to + * make sense...) + */ + addr_t addr = ph64->p_paddr; +...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...ments at virtual addresses corresponding + * to their physical addresses (our virtual == guest physical). */ + for (i = 0; i < ehdr->e_phnum; i++) { + if (phdr[i].p_type != PT_LOAD) + continue; + + verbose("Section %i: size %i addr %p\n", + i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); + + /* We expect linear address space. */ + if (!*page_offset) + *page_offset = phdr[i].p_vaddr - phdr[i].p_paddr; + else if (*page_offset != phdr[i].p_vaddr - phdr[i].p_paddr) + errx(1, "Page offset of section %i different", i); + + if (phdr[i].p_paddr < start) + start = p...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...ments at virtual addresses corresponding + * to their physical addresses (our virtual == guest physical). */ + for (i = 0; i < ehdr->e_phnum; i++) { + if (phdr[i].p_type != PT_LOAD) + continue; + + verbose("Section %i: size %i addr %p\n", + i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); + + /* We expect linear address space. */ + if (!*page_offset) + *page_offset = phdr[i].p_vaddr - phdr[i].p_paddr; + else if (*page_offset != phdr[i].p_vaddr - phdr[i].p_paddr) + errx(1, "Page offset of section %i different", i); + + if (phdr[i].p_paddr < start) + start = p...
2009 Apr 03
0
PATCH: Handle virtual entry point in mboot.c32
...a similar calculation. */ + if( + (ehdr->e_entry >= phdr[i].p_vaddr) + && + (ehdr->e_entry < (phdr[i].p_vaddr + run_size)) + ) { + realEntry = (ehdr->e_entry + phdr[i].p_paddr) - phdr[i].p_vaddr; + } + /* Place the segment where it wants to be */ run_addr = phdr[i].p_paddr; place_kernel_section(run_addr, run_size); @@ -753,7 +771,7 @@ static size_t load_kernel(struct multibo } /...
2020 Aug 13
2
Adding sections in a binary
...ction is not part of the memory image and not used by the program (unless for some rare introspection use cases) * adding a SHF_ALLOC section is difficult. You likely need to fix the containing PT_LOAD segment. llvm-objcopy only does the base p_offset fix. You need to take care p_vaddr/p_paddr/p_filesz/p_memsz by your self. + adding a section smaller than the known lowest address (ET_EXEC with a non-zero image base) or larger than the known largest address: The PT_LOAD fixes are doable. + adding a section within the existing address ranges: this is very difficult du...
2007 Apr 18
1
[PATCH] Unified lguest launcher
This is a new version of the unified lguest launcher that applies to the current tree. According to rusty's suggestion, I'm bothering less to be able to load 32 bit kernels on 64-bit machines: changing the launcher for such case would be the easy part! In the absence of further objections, I'll commit it. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> -- =
2007 Apr 18
1
[PATCH] Unified lguest launcher
This is a new version of the unified lguest launcher that applies to the current tree. According to rusty's suggestion, I'm bothering less to be able to load 32 bit kernels on 64-bit machines: changing the launcher for such case would be the easy part! In the absence of further objections, I'll commit it. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> -- =
2008 Feb 13
4
[PATCHv3 1/3] x86: use ELF format in compressed images.
...t;Failed to allocate space for phdrs"); + + memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum); + + for (i=0; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: +#ifdef CONFIG_RELOCATABLE + dest = output; + dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); +#else + dest = (void*)(phdr->p_paddr); +#endif + memcpy(dest, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap,...
2008 Feb 13
4
[PATCHv3 1/3] x86: use ELF format in compressed images.
...t;Failed to allocate space for phdrs"); + + memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum); + + for (i=0; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: +#ifdef CONFIG_RELOCATABLE + dest = output; + dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); +#else + dest = (void*)(phdr->p_paddr); +#endif + memcpy(dest, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap,...
2008 Feb 06
0
[PATCHv2 1/3] x86: use ELF format in compressed images.
...t;Failed to allocate space for phdrs"); + + memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum); + + for (i=0; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: +#ifdef CONFIG_RELOCATABLE + dest = output; + dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); +#else + dest = (void*)(phdr->p_paddr); +#endif + memcpy(dest, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap,...
2008 Feb 06
0
[PATCHv2 1/3] x86: use ELF format in compressed images.
...t;Failed to allocate space for phdrs"); + + memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum); + + for (i=0; i<ehdr.e_phnum; i++) { + phdr = &phdrs[i]; + + switch (phdr->p_type) { + case PT_LOAD: +#ifdef CONFIG_RELOCATABLE + dest = output; + dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); +#else + dest = (void*)(phdr->p_paddr); +#endif + memcpy(dest, + output + phdr->p_offset, + phdr->p_filesz); + break; + default: /* Ignore other PT_* */ break; + } + } +} + asmlinkage void decompress_kernel(void *rmode, memptr heap,...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...e_phnum + .word 40 # e_shentsize + .word 0 # e_shnum + .word 0 # e_shstrndx +e_ehdr: + + .org 71 +normalize: # Normalize the start address ljmp $BOOTSEG, $start2 + + .org 80 +phdr: + .int PT_LOAD # p_type + .int _text # p_offset + .int 0x8000 # p_vaddr + .int 0x8000 # p_paddr + .int _filesz # p_filesz + .int _memsz # p_memsz + .int PF_R | PF_W | PF_X # p_flags + .int 4 # p_align +e_phdr1: + .int PT_LOAD # p_type + .int kernel - bootsect_start # p_offset + .int LOAD_PHYSICAL_ADDR # p_vaddr + .int LOAD_PHYSICAL_ADDR # p_paddr + .int kernel_size...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...e_phnum + .word 40 # e_shentsize + .word 0 # e_shnum + .word 0 # e_shstrndx +e_ehdr: + + .org 71 +normalize: # Normalize the start address ljmp $BOOTSEG, $start2 + + .org 80 +phdr: + .int PT_LOAD # p_type + .int _text # p_offset + .int 0x8000 # p_vaddr + .int 0x8000 # p_paddr + .int _filesz # p_filesz + .int _memsz # p_memsz + .int PF_R | PF_W | PF_X # p_flags + .int 4 # p_align +e_phdr1: + .int PT_LOAD # p_type + .int kernel - bootsect_start # p_offset + .int LOAD_PHYSICAL_ADDR # p_vaddr + .int LOAD_PHYSICAL_ADDR # p_paddr + .int kernel_size...
2017 Feb 17
3
Linking Linux kernel with LLD
>>That boot_params.hdr.code32_start field is probably either invalid (bad reloc or something else causing the bootloader to >>calculate the wrong address) or valid but the thing it thinks it is pointing to wasn't loaded (missing PT_LOAD etc.). >boot_params.hdr.code32_start field is valid :) It is 0x100000, like expected > >Then I suspect that that segment isn't being