search for: e_entry

Displaying 20 results from an estimated 38 matches for "e_entry".

Did you mean: __entry
2009 Apr 03
0
PATCH: Handle virtual entry point in mboot.c32
...run (if + * their startup code is position-independent). For instance, a kernel whose + * entry point is at 0xFF400000 virtual, but 0x100000 physical will be able to + * be booted because of this special handling. */ + Elf32_Addr realEntry = ehdr->e_entry; + #ifdef DEBUG printf("Using ELF header.\n"); #endif @@ -682,6 +689,17 @@ static size_t load_kernel(struct multibo /* Skip segments that don't take up any memory */ if (run_size == 0) continue; + /* If the entry point...
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...s_solaris(eh)) opt.solaris = true; @@ -263,6 +279,112 @@ return NULL; } sh[i].sh_addr = addr; + } + } + } else if (eh64 && !(opt.aout && mbh_len && + (mbh->flags & MULTIBOOT_AOUT_KLUDGE))) { + /* 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...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...hdr[i].p_paddr) + err(1, "Mmaping vmlinux segment %i returned %p not %p (%p)", + i, addr, (void *)(long)phdr[i].p_paddr, &phdr[i].p_paddr); + } + + *pgdir_addr = finish(mem, page_offset, initrd, ird_size); + /* Entry is physical address: convert to virtual */ + return ehdr->e_entry + *page_offset; +} + +/* Returns the entry point */ +static unsigned long map_elf64(int elf_fd, const Elf64_Ehdr *ehdr, unsigned long mem, + unsigned long *pgdir_addr, + const char *initrd, unsigned long *ird_size, + unsigned long *page_offset) +{ +#ifdef CONFIG_X86_64 + void *addr; + E...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...hdr[i].p_paddr) + err(1, "Mmaping vmlinux segment %i returned %p not %p (%p)", + i, addr, (void *)(long)phdr[i].p_paddr, &phdr[i].p_paddr); + } + + *pgdir_addr = finish(mem, page_offset, initrd, ird_size); + /* Entry is physical address: convert to virtual */ + return ehdr->e_entry + *page_offset; +} + +/* Returns the entry point */ +static unsigned long map_elf64(int elf_fd, const Elf64_Ehdr *ehdr, unsigned long mem, + unsigned long *pgdir_addr, + const char *initrd, unsigned long *ird_size, + unsigned long *page_offset) +{ +#ifdef CONFIG_X86_64 + void *addr; + E...
2013 Dec 01
0
[PATCH v2 4/4] efi: PE file size differ from in-memory size
...argv) /* * Parse the ELF header and find the entry point. */ - fread((void *)&e32_hdr, sizeof(e32_hdr), 1, f_in); + fread((void *)&e32_hdr, sizeof(e32_hdr), 1, f_in); if (e32_hdr.e_ident[EI_CLASS] == ELFCLASS32) { id = e32_hdr.e_ident; class = ELFCLASS32; entry = e32_hdr.e_entry; - shoff = e32_hdr.e_shoff; - shnum = e32_hdr.e_shnum; - shstrndx = e32_hdr.e_shstrndx; - shentsize = e32_hdr.e_shentsize; + phoff = e32_hdr.e_phoff; + phnum = e32_hdr.e_phnum; + phentsize = e32_hdr.e_phentsize; } else if (e32_hdr.e_ident[EI_CLASS] == ELFCLASS64) { /* read the header...
2013 Nov 27
0
[PATCH 4/4] efi: PE file size differ from in-memory size
...argv) /* * Parse the ELF header and find the entry point. */ - fread((void *)&e32_hdr, sizeof(e32_hdr), 1, f_in); + fread((void *)&e32_hdr, sizeof(e32_hdr), 1, f_in); if (e32_hdr.e_ident[EI_CLASS] == ELFCLASS32) { id = e32_hdr.e_ident; class = ELFCLASS32; entry = e32_hdr.e_entry; - shoff = e32_hdr.e_shoff; - shnum = e32_hdr.e_shnum; - shstrndx = e32_hdr.e_shstrndx; - shentsize = e32_hdr.e_shentsize; + phoff = e32_hdr.e_phoff; + phnum = e32_hdr.e_phnum; + phentsize = e32_hdr.e_phentsize; } else if (e32_hdr.e_ident[EI_CLASS] == ELFCLASS64) { /* read the header...
2015 Oct 10
2
[PATCH 2/2] com32/mboot/map.c: removed trailing spaces
...ize_t len) sh[i].sh_addr = addr; } } - } else if (eh64 && !(opt.aout && mbh_len && + } else if (eh64 && !(opt.aout && mbh_len && (mbh->flags & MULTIBOOT_AOUT_KLUDGE))) { /* Load 64-bit ELF */ regs.eip = eh64->e_entry; /* Can be overridden further down... */ @@ -378,7 +378,7 @@ struct multiboot_header *map_image(void *ptr, size_t len) continue; /* SHF_ALLOC sections should have PHDRs */ align = sh64[i].sh_addralign ? sh64[i].sh_addralign : 0; - addr = map_data((char *)ptr + sh64[i].sh_offset, + ad...
2008 Oct 20
0
PATCH[001/001]: mboot.c: prefer ELF header over multiboot header
...->e_phnum*sizeof (*phdr) > load_size) { printf("Fatal: malformed ELF header overruns EOF.\n"); exit(1); @@ -760,6 +700,60 @@ static size_t load_kernel(struct multiboot_info *mbi, char *cmdline) /* Done! */ return ehdr->e_entry; + } else + + /* Does the MB header specify load addresses? */ + if (mbh->flags & MULTIBOOT_AOUT_KLUDGE) { + + /* Use the offsets in the multiboot header */ +#ifdef DEBUG + printf("Using multiboot header.\n"); +#endif + +...
2013 Nov 27
20
[PATCH 0/4] efi: PE header generation fix
The PE headers of the generated efi file were quite buggy. And since OVMF perform a few consistency checks, syslinux was unable to run on it. I don't pretend to have a thorough understanding of the PE+ headers, some bugs may remain. :) Celelibi (4): efi: Fix PE header field rva_and_sizes_nr efi: Location, size and alignment of .text section efi: Useless relocations in PE file efi: PE
2007 Jun 01
2
another RFC patch: bzImage with ELF payload
...One thing that fell out of this is that code32_start end up being a pointer to the ELF header rather than an entrypoint. Rather than reproducing Vivek's (?) hack of making the ELF header itself executable, I changed the 16-bit code to check for an ELF magic number at code32_start and use the e_entry to get the actual entrypoint. This seems like approximately the right way of doing this, but I'm not sure how we want to formalize it. It's certainly easier than trying to extract the payload's entry address and copying it to code32_start in the boot_params block, and we need a pointe...
2007 Jun 01
2
another RFC patch: bzImage with ELF payload
...One thing that fell out of this is that code32_start end up being a pointer to the ELF header rather than an entrypoint. Rather than reproducing Vivek's (?) hack of making the ELF header itself executable, I changed the 16-bit code to check for an ELF magic number at code32_start and use the e_entry to get the actual entrypoint. This seems like approximately the right way of doing this, but I'm not sure how we want to formalize it. It's certainly easier than trying to extract the payload's entry address and copying it to code32_start in the boot_params block, and we need a pointe...
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
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...(unsigned int)VDSO_HIGH_BASE); + + /* Sanity checks against insmoding binaries or wrong arch, + weird elf version */ + if (memcmp(hdr->e_ident, ELFMAG, 4) !=3D 0 || + !elf_check_arch(hdr) || + hdr->e_type !=3D ET_DYN) + panic("Bogus ELF in vsyscall DSO\n"); + + hdr->e_entry +=3D VDSO_HIGH_BASE; + sechdrs =3D (void *)hdr + hdr->e_shoff; + secstrings =3D (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + + for (i =3D 1; i < hdr->e_shnum; i++) { + if (!(sechdrs[i].sh_flags & SHF_ALLOC)) + continue; + + sechdrs[i].sh_addr +=3D VDSO_HIGH_BASE; + if (s...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...(unsigned int)VDSO_HIGH_BASE); + + /* Sanity checks against insmoding binaries or wrong arch, + weird elf version */ + if (memcmp(hdr->e_ident, ELFMAG, 4) !=3D 0 || + !elf_check_arch(hdr) || + hdr->e_type !=3D ET_DYN) + panic("Bogus ELF in vsyscall DSO\n"); + + hdr->e_entry +=3D VDSO_HIGH_BASE; + sechdrs =3D (void *)hdr + hdr->e_shoff; + secstrings =3D (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + + for (i =3D 1; i < hdr->e_shnum; i++) { + if (!(sechdrs[i].sh_flags & SHF_ALLOC)) + continue; + + sechdrs[i].sh_addr +=3D VDSO_HIGH_BASE; + if (s...
2009 Jan 14
5
[PATCH] Support cross-bitness guest when core-dumping
This patch allows core-dumping to work on a cross-bit host/guest configuration, whereas previously that was not supported. It supports both PV and FV guests. The core file format generated by the host, needs to match that of the guest, so an alignment issue is addressed, along with the p2m frame list handling being done according to the guest size. Signed-off-by: Bruce Rogers
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...N(ehdr->e_ident[EI_MAG1] != ELFMAG1); + BUG_ON(ehdr->e_ident[EI_MAG2] != ELFMAG2); + BUG_ON(ehdr->e_ident[EI_MAG3] != ELFMAG3); + BUG_ON(ehdr->e_ident[EI_CLASS] != ELFCLASS32); + BUG_ON(ehdr->e_ident[EI_DATA] != ELFDATA2LSB); + BUG_ON(ehdr->e_ehsize < sizeof(*ehdr)); + ehdr->e_entry += new_base - old_base; + BUG_ON(ehdr->e_phentsize < sizeof(Elf32_Phdr)); + for (i = 0; i < ehdr->e_phnum; ++i) { + Elf32_Phdr *phdr = (void *)((unsigned long)ehdr + ehdr->e_phoff + i * ehdr->e_phentsize); + + phdr->p_vaddr += new_base - old_base; + switch(phdr->p_type) {...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...N(ehdr->e_ident[EI_MAG1] != ELFMAG1); + BUG_ON(ehdr->e_ident[EI_MAG2] != ELFMAG2); + BUG_ON(ehdr->e_ident[EI_MAG3] != ELFMAG3); + BUG_ON(ehdr->e_ident[EI_CLASS] != ELFCLASS32); + BUG_ON(ehdr->e_ident[EI_DATA] != ELFDATA2LSB); + BUG_ON(ehdr->e_ehsize < sizeof(*ehdr)); + ehdr->e_entry += new_base - old_base; + BUG_ON(ehdr->e_phentsize < sizeof(Elf32_Phdr)); + for (i = 0; i < ehdr->e_phnum; ++i) { + Elf32_Phdr *phdr = (void *)((unsigned long)ehdr + ehdr->e_phoff + i * ehdr->e_phentsize); + + phdr->p_vaddr += new_base - old_base; + switch(phdr->p_type) {...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...N(ehdr->e_ident[EI_MAG1] != ELFMAG1); + BUG_ON(ehdr->e_ident[EI_MAG2] != ELFMAG2); + BUG_ON(ehdr->e_ident[EI_MAG3] != ELFMAG3); + BUG_ON(ehdr->e_ident[EI_CLASS] != ELFCLASS32); + BUG_ON(ehdr->e_ident[EI_DATA] != ELFDATA2LSB); + BUG_ON(ehdr->e_ehsize < sizeof(*ehdr)); + ehdr->e_entry += new_base - old_base; + BUG_ON(ehdr->e_phentsize < sizeof(Elf32_Phdr)); + for (i = 0; i < ehdr->e_phnum; ++i) { + Elf32_Phdr *phdr = (void *)((unsigned long)ehdr + ehdr->e_phoff + i * ehdr->e_phentsize); + + phdr->p_vaddr += new_base - old_base; + switch(phdr->p_type) {...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...id *)phdr[i].p_paddr) + err(1, "Mmaping vmlinux segment %i returned %p not %p (%p)", + i, addr, (void *)phdr[i].p_paddr, &phdr[i].p_paddr); + } + + *pgdir_addr = finish(mem, page_offset, initrd, ird_size); + /* Entry is physical address: convert to virtual */ + return ehdr->e_entry + *page_offset; +} + +static unsigned long intuit_page_offset(unsigned char *img, unsigned long len) +{ + unsigned int i, possibilities[256]; + + for (i = 0; i + 4 < len; i++) { + /* mov 0xXXXXXXXX,%eax */ + if (img[i] == 0xA1 && ++possibilities[img[i+4]] > 3) + return (unsigned l...