search for: elf32_ehdr

Displaying 20 results from an estimated 43 matches for "elf32_ehdr".

2008 Oct 20
0
PATCH[001/001]: mboot.c: prefer ELF header over multiboot header
...; - } else { - /* No BSS */ - add_section(run_addr, seg_addr, run_size); - } - - /* Done. */ - return mbh->entry_addr; - - } else { + /* Look for a bootable ELF32 header */ + if ((load_size > sizeof(Elf32_Ehdr) && + BOOTABLE_I386_ELF((*((Elf32_Ehdr *) load_addr))))) { - /* Now look for an ELF32 header */ ehdr = (Elf32_Ehdr *)load_addr; - if (*(unsigned long *)ehdr != 0x464c457f - || ehdr->e_ident[EI_DATA] != ELFDATA2LSB -...
2007 Apr 18
4
[patch 0/2] Updates to compat VDSOs
Hi Andi, Here's a couple of patches to fix up COMPAT_VDSO: The first is a straightforward implementation of Jan's original idea of relocating the VDSO to match its mapped location. Unlike Jan and Zach's version, I changed it to relocate based on the phdrs rather than the sections; the result is pleasantly compact. The second patch takes advantage of the fact that all the
2007 Apr 18
4
[patch 0/2] Updates to compat VDSOs
Hi Andi, Here's a couple of patches to fix up COMPAT_VDSO: The first is a straightforward implementation of Jan's original idea of relocating the VDSO to match its mapped location. Unlike Jan and Zach's version, I changed it to relocate based on the phdrs rather than the sections; the result is pleasantly compact. The second patch takes advantage of the fact that all the
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...14 @@ static u32 finish(unsigned long mem, uns return (unsigned long)pgdir; } +static unsigned long finish64(unsigned long mem, unsigned long *page_offset, + const char *initrd, unsigned long *ird_size) +{ + return 0; +} + /* Returns the entry point */ -static u32 map_elf(int elf_fd, const Elf32_Ehdr *ehdr, unsigned long mem, +static unsigned long map_elf32(int elf_fd, const Elf32_Ehdr *ehdr, unsigned 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 con...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...14 @@ static u32 finish(unsigned long mem, uns return (unsigned long)pgdir; } +static unsigned long finish64(unsigned long mem, unsigned long *page_offset, + const char *initrd, unsigned long *ird_size) +{ + return 0; +} + /* Returns the entry point */ -static u32 map_elf(int elf_fd, const Elf32_Ehdr *ehdr, unsigned long mem, +static unsigned long map_elf32(int elf_fd, const Elf32_Ehdr *ehdr, unsigned 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 con...
2007 Apr 18
4
[patch 0/4] Clean up asm/bugs.h, identify_cpu() and update COMPAT_VDSO
Hi Andi, Four patches: - clean up asm/bugs.h, by moving all the C code into its own C file - split identify_cpu() into boot and secondary variants, so that boot-time setup functions can be marked __init - repost of the COMPAT_VDSO patches with a bit more robustness from unknown DT_tags, and functions marked __init, since all this is boot-time only setup. Thanks, J --
2007 Apr 18
4
[patch 0/4] Clean up asm/bugs.h, identify_cpu() and update COMPAT_VDSO
Hi Andi, Four patches: - clean up asm/bugs.h, by moving all the C code into its own C file - split identify_cpu() into boot and secondary variants, so that boot-time setup functions can be marked __init - repost of the COMPAT_VDSO patches with a bit more robustness from unknown DT_tags, and functions marked __init, since all this is boot-time only setup. Thanks, J --
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...el/sysenter.c 2007-03-15 18:27:43.000000000 = -0800 @@ -72,6 +72,99 @@ extern const char vsyscall_int80_start, = extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; static struct page *syscall_pages[1]; = +#ifdef CONFIG_COMPAT_VDSO +static void fixup_vsyscall_elf(char *page) +{ + Elf32_Ehdr *hdr; + Elf32_Shdr *sechdrs; + Elf32_Phdr *phdr; + char *secstrings; + int i, j, n; + + hdr =3D (Elf32_Ehdr *)page; + = + printk("Remapping vsyscall page to %08x\n", (unsigned int)VDSO_HIGH_BASE); + + /* Sanity checks against insmoding binaries or wrong arch, + weird elf versio...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...el/sysenter.c 2007-03-15 18:27:43.000000000 = -0800 @@ -72,6 +72,99 @@ extern const char vsyscall_int80_start, = extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; static struct page *syscall_pages[1]; = +#ifdef CONFIG_COMPAT_VDSO +static void fixup_vsyscall_elf(char *page) +{ + Elf32_Ehdr *hdr; + Elf32_Shdr *sechdrs; + Elf32_Phdr *phdr; + char *secstrings; + int i, j, n; + + hdr =3D (Elf32_Ehdr *)page; + = + printk("Remapping vsyscall page to %08x\n", (unsigned int)VDSO_HIGH_BASE); + + /* Sanity checks against insmoding binaries or wrong arch, + weird elf versio...
2005 Mar 06
1
testers sought for script to interpret ELF/klibc executables
...s (32 or 64 bit) # - the first private header with type PT_INTERP gives offset and # size of the interpreter filename in the executable # - extract that filename and strip trailing null byte. # use warnings; use strict; sub PATH_MAX () {4096;} sub SZ_ELF32HDR () {52;} sub SZ_ELF64HDR () {64;} # Elf32_Ehdr->e_ident[4]: are variables 32 or 64 bit sub ELFCLASS32 () {1;} sub ELFCLASS64 () {2;} # Elf32_Ehdr->e_type: whether it's an executable, core, object # file or something else entirely. sub ET_EXEC () {2;} sub ET_DYN () {3;} # # ELF Private header # sub SZ_ELF32PHDR {32;} sub SZ_ELF64PHDR...
2003 Jan 07
1
klibc-0.72 released
This adds [f]getc() and fgets() for parsing config files. Probably hard to avoid. Still trying to decide if I actually want to add system() or not. -hpa
2012 Apr 17
2
[GIT PULL] elflink warning fixes and auto extension support
...--- a/com32/lib/sys/module/elf_module.c +++ b/com32/lib/sys/module/elf_module.c @@ -14,6 +14,7 @@ #include <linux/list.h> #include <sys/module.h> +#include <sys/exec.h> #include "elfutils.h" #include "common.h" @@ -50,7 +51,7 @@ static int check_header(Elf32_Ehdr *elf_hdr) { static int load_segments(struct elf_module *module, Elf32_Ehdr *elf_hdr) { int i; int res = 0; - void *pht = NULL; + char *pht = NULL; Elf32_Phdr *cr_pht; Elf32_Addr min_addr = 0x00000000; // Min. ELF vaddr @@ -136,8 +137,8 @@ static int load_segments(struct elf_module *modu...
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> -- =
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...Extend Multiboot1 with support for ELF64 file format diff U3 syslinux-6.03/com32/mboot/map.c syslinux-6.03_mbootELF64/com32/mboot/map.c --- syslinux-6.03/com32/mboot/map.c Mon Oct 06 19:27:44 2014 +++ syslinux-6.03_mbootELF64/com32/mboot/map.c Sat Oct 10 09:13:45 2015 @@ -106,6 +106,11 @@ Elf32_Ehdr *eh = ptr; Elf32_Phdr *ph; Elf32_Shdr *sh; + + Elf64_Ehdr *eh64 = ptr; + Elf64_Phdr *ph64; + Elf64_Shdr *sh64; + unsigned int i, mbh_offset; uint32_t bad_flags; @@ -150,6 +155,17 @@ !eh->e_phnum || eh->e_phoff + eh->e_phentsize * eh->e_phnum > len)...
2008 Feb 13
4
[PATCHv3 1/3] x86: use ELF format in compressed images.
...lt;linux/elf.h> #include <asm/io.h> #include <asm/page.h> #include <asm/boot.h> @@ -365,6 +370,56 @@ static void error(char *x) asm("hlt"); } +static void parse_elf(void *output) +{ +#ifdef CONFIG_X86_64 + Elf64_Ehdr ehdr; + Elf64_Phdr *phdrs, *phdr; +#else + Elf32_Ehdr ehdr; + Elf32_Phdr *phdrs, *phdr; +#endif + void *dest; + int i; + + memcpy(&ehdr, output, sizeof(ehdr)); + if(ehdr.e_ident[EI_MAG0] != ELFMAG0 || + ehdr.e_ident[EI_MAG1] != ELFMAG1 || + ehdr.e_ident[EI_MAG2] != ELFMAG2 || + ehdr.e_ident[EI_MAG3] != ELFMAG3) + { + error("Kernel i...
2008 Feb 13
4
[PATCHv3 1/3] x86: use ELF format in compressed images.
...lt;linux/elf.h> #include <asm/io.h> #include <asm/page.h> #include <asm/boot.h> @@ -365,6 +370,56 @@ static void error(char *x) asm("hlt"); } +static void parse_elf(void *output) +{ +#ifdef CONFIG_X86_64 + Elf64_Ehdr ehdr; + Elf64_Phdr *phdrs, *phdr; +#else + Elf32_Ehdr ehdr; + Elf32_Phdr *phdrs, *phdr; +#endif + void *dest; + int i; + + memcpy(&ehdr, output, sizeof(ehdr)); + if(ehdr.e_ident[EI_MAG0] != ELFMAG0 || + ehdr.e_ident[EI_MAG1] != ELFMAG1 || + ehdr.e_ident[EI_MAG2] != ELFMAG2 || + ehdr.e_ident[EI_MAG3] != ELFMAG3) + { + error("Kernel i...
2007 Apr 18
1
[RFC, PATCH 7/24] i386 Vmi memory hole
Create a configurable hole in the linear address space at the top of memory. A more advanced interface is needed to negotiate how much space the hypervisor is allowed to steal, but in the end, it seems most likely that a fixed constant size will be chosen for the compiled kernel, potentially propagated to an information page used by paravirtual initialization to determine interface compatibility.
2007 Apr 18
1
[RFC, PATCH 7/24] i386 Vmi memory hole
Create a configurable hole in the linear address space at the top of memory. A more advanced interface is needed to negotiate how much space the hypervisor is allowed to steal, but in the end, it seems most likely that a fixed constant size will be chosen for the compiled kernel, potentially propagated to an information page used by paravirtual initialization to determine interface compatibility.
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...((u32)linear + i*sizeof(u32)) | PAGE_PRESENT); + verbose("Top level %lu = %#08x\n", + (i + *page_offset/getpagesize())/1024, + pgdir[(i + *page_offset/getpagesize())/1024]); + } + + return (unsigned long)pgdir; +} + +/* Returns the entry point */ +static u32 map_elf(int elf_fd, const Elf32_Ehdr *ehdr, unsigned long mem, + unsigned long *pgdir_addr, + const char *initrd, unsigned long *ird_size, + unsigned long *page_offset) +{ + void *addr; + Elf32_Phdr phdr[ehdr->e_phnum]; + unsigned int i; + + /* Sanity checks. */ + if (ehdr->e_type != ET_EXEC + || ehdr->e_machi...