search for: elfmag

Displaying 20 results from an estimated 20 matches for "elfmag".

2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...X_DMA_SECTIONS]; unsigned num = 0; @@ -916,20 +1068,45 @@ static void handle_input(int fd, int chi } } +static unsigned long load_elf_header(unsigned char *elf_nident) +{ + errno = 0; + switch (*(elf_nident+EI_CLASS)) { + case ELFCLASS32: + finish = finish32; + if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0) + return (unsigned long)map_elf32; + else + return (unsigned long)load_bzimage; + break; + case ELFCLASS64: + finish = finish64; + if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0) + return (unsigned long)map_elf64; + else + return (unsigned long)load_bzimage; +...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...X_DMA_SECTIONS]; unsigned num = 0; @@ -916,20 +1068,45 @@ static void handle_input(int fd, int chi } } +static unsigned long load_elf_header(unsigned char *elf_nident) +{ + errno = 0; + switch (*(elf_nident+EI_CLASS)) { + case ELFCLASS32: + finish = finish32; + if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0) + return (unsigned long)map_elf32; + else + return (unsigned long)load_bzimage; + break; + case ELFCLASS64: + finish = finish64; + if (memcmp(elf_nident, ELFMAG, SELFMAG) == 0) + return (unsigned long)map_elf64; + else + return (unsigned long)load_bzimage; +...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...32_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 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...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...32_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 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...
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
2015 Jan 26
2
[LLVMdev] [llvm] r188726 - Adding PIC support for ELF on x86_64 platforms
...ntries to zero. We'll fill them in as + // needed when GOT-based relocations are applied. + memset(Addr, 0, TotalSize); + GOTSectionID = SectionID; + } +} + bool RuntimeDyldELF::isCompatibleFormat(const ObjectBuffer *Buffer) const { if (Buffer->getBufferSize() < strlen(ELF::ElfMagic)) return false; Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h?rev=188726&r1=188725&r2=188726&view=diff ===================================================...
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
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...tatic 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; + + /* 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 VSYSCALL_RELOCATION; + + sechdrs =3D (void *)hdr + hdr->e_shoff; + secstrings =3D (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + + for (i =3...
2007 Apr 18
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...tatic 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; + + /* 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 VSYSCALL_RELOCATION; + + sechdrs =3D (void *)hdr + hdr->e_shoff; + secstrings =3D (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + + for (i =3...
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
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...ng /dev/zero"); + + mem = memparse(argv[1]); + kern_fd = open(argv[2], O_RDONLY, 0); + if (kern_fd < 0) + err(1, "Opening %s", argv[2]); + + if (read(kern_fd, &hdr, sizeof(hdr)) != sizeof(hdr)) + err(1, "Reading %s elf header", argv[2]); + + if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) + load = map_elf; + else + load = load_bzimage; + + devices.max_infd = -1; + devices.dev = NULL; + FD_ZERO(&devices.infds); + + devdescs = map_pages(mem, 1); + arg = 3; + while (argv[arg] && argv[arg][0] == '-') { + const char *argval; + + if ((argval = get_a...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...ng /dev/zero"); + + mem = memparse(argv[1]); + kern_fd = open(argv[2], O_RDONLY, 0); + if (kern_fd < 0) + err(1, "Opening %s", argv[2]); + + if (read(kern_fd, &hdr, sizeof(hdr)) != sizeof(hdr)) + err(1, "Reading %s elf header", argv[2]); + + if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) + load = map_elf; + else + load = load_bzimage; + + devices.max_infd = -1; + devices.dev = NULL; + FD_ZERO(&devices.infds); + + devdescs = map_pages(mem, 1); + arg = 3; + while (argv[arg] && argv[arg][0] == '-') { + const char *argval; + + if ((argval = get_a...
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 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...page_offset); + } + } + errx(1, "Could not find kernel in bzImage"); +} + +static unsigned long load_kernel(int fd, unsigned long *page_offset) +{ + Elf32_Ehdr hdr; + + if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) + err(1, "Reading kernel"); + + if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) + return map_elf(fd, &hdr, page_offset); + + return load_bzimage(fd, page_offset); +} + +static inline unsigned long page_align(unsigned long addr) +{ + return ((addr + getpagesize()-1) & ~(getpagesize()-1)); +} + +/* initrd gets loaded at top of memory: return length. */ +...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...page_offset); + } + } + errx(1, "Could not find kernel in bzImage"); +} + +static unsigned long load_kernel(int fd, unsigned long *page_offset) +{ + Elf32_Ehdr hdr; + + if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) + err(1, "Reading kernel"); + + if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) + return map_elf(fd, &hdr, page_offset); + + return load_bzimage(fd, page_offset); +} + +static inline unsigned long page_align(unsigned long addr) +{ + return ((addr + getpagesize()-1) & ~(getpagesize()-1)); +} + +/* initrd gets loaded at top of memory: return length. */ +...
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c