search for: e_shoff

Displaying 20 results from an estimated 32 matches for "e_shoff".

Did you mean: e_phoff
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 Jul 21
5
[LLVMdev] Some thought on handling ELF shared libraries in lld
Most ELF shared libraries can be sliced in two ways. One is following the information in the program headers (e_phoff). The other is following the information in the section headers (e_shoff). Regular relocatable objects only have the section header. At runtime, the dynamic linker only uses the program headers. In fact, the section headers is optional. When given a shared library, how should the static linker handle it? Note that, unlike the dynamic linker, the static one has to fi...
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...urn NULL; + } + } + if (addr + msize > mboot_high_water_mark) + mboot_high_water_mark = addr + msize; + } else { + /* Ignore this program header */ + } + + ph64 = (Elf64_Phdr *) ((char *)ph64 + eh64->e_phentsize); + } + + /* Load the ELF symbol table */ + if (eh64->e_shoff) { + addr_t addr, len; + + sh64 = (Elf64_Shdr *) ((char *)eh64 + eh64->e_shoff); + + len = eh64->e_shentsize * eh64->e_shnum; + /* + * Align this, but don't pad -- in general this means a bunch of + * smaller sections gets packed into a single page. + */...
2013 Dec 01
0
[PATCH v2 4/4] efi: PE file size differ from in-memory size
...F 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 again for x86_64 @@ -217,10...
2013 Nov 27
0
[PATCH 4/4] efi: PE file size differ from in-memory size
...F 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 again for x86_64 @@ -213,10...
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 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...oding 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 (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3D=3D...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...oding 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 (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3D=3D...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...unsupported type %08X\n", i, phdr->p_type); + WARN_ON(1); + break; + } + } + BUG_ON(ehdr->e_shentsize < sizeof(Elf32_Shdr)); + BUG_ON(ehdr->e_shnum >= SHN_LORESERVE); + for (i = 1; i < ehdr->e_shnum; ++i) { + Elf32_Shdr *shdr = (void *)((unsigned long)ehdr + ehdr->e_shoff + i * ehdr->e_shentsize); + + if (!(shdr->sh_flags & SHF_ALLOC)) + continue; + shdr->sh_addr += new_base - old_base; + switch(shdr->sh_type) { + case SHT_DYNAMIC: + case SHT_HASH: + case SHT_NOBITS: + case SHT_NOTE: + case SHT_PROGBITS: + case SHT_STRTAB: + case 0x6fffff...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...unsupported type %08X\n", i, phdr->p_type); + WARN_ON(1); + break; + } + } + BUG_ON(ehdr->e_shentsize < sizeof(Elf32_Shdr)); + BUG_ON(ehdr->e_shnum >= SHN_LORESERVE); + for (i = 1; i < ehdr->e_shnum; ++i) { + Elf32_Shdr *shdr = (void *)((unsigned long)ehdr + ehdr->e_shoff + i * ehdr->e_shentsize); + + if (!(shdr->sh_flags & SHF_ALLOC)) + continue; + shdr->sh_addr += new_base - old_base; + switch(shdr->sh_type) { + case SHT_DYNAMIC: + case SHT_HASH: + case SHT_NOBITS: + case SHT_NOTE: + case SHT_PROGBITS: + case SHT_STRTAB: + case 0x6fffff...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...unsupported type %08X\n", i, phdr->p_type); + WARN_ON(1); + break; + } + } + BUG_ON(ehdr->e_shentsize < sizeof(Elf32_Shdr)); + BUG_ON(ehdr->e_shnum >= SHN_LORESERVE); + for (i = 1; i < ehdr->e_shnum; ++i) { + Elf32_Shdr *shdr = (void *)((unsigned long)ehdr + ehdr->e_shoff + i * ehdr->e_shentsize); + + if (!(shdr->sh_flags & SHF_ALLOC)) + continue; + shdr->sh_addr += new_base - old_base; + switch(shdr->sh_type) { + case SHT_DYNAMIC: + case SHT_HASH: + case SHT_NOBITS: + case SHT_NOTE: + case SHT_PROGBITS: + case SHT_STRTAB: + case 0x6fffff...
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 May 31
1
[patch rfc wip] first cut of ELF bzImage
...BI_STANDALONE + .byte 0xeb, 0x3d, 0, 0, 0, 0, 0, 0 +#ifndef CONFIG_RELOCATABLE + .word ET_EXEC # e_type +#else + .word ET_DYN # e_type +#endif + .word EM_386 # e_machine + .int 1 # e_version + .int LOAD_PHYSICAL_ADDR # e_entry + .int phdr - bootsect_start # e_phoff + .int 0 # e_shoff + .int 0 # e_flags + .word e_ehdr - ehdr # e_ehsize + .word e_phdr1 - phdr # e_phentsize + .word (e_phdr - phdr)/(e_phdr1 - phdr) # e_phnum + .word 40 # e_shentsize + .word 0 # e_shnum + .word 0 # e_shstrndx +e_ehdr: + + .org 71 +normalize: # Normalize the start address ljmp...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...BI_STANDALONE + .byte 0xeb, 0x3d, 0, 0, 0, 0, 0, 0 +#ifndef CONFIG_RELOCATABLE + .word ET_EXEC # e_type +#else + .word ET_DYN # e_type +#endif + .word EM_386 # e_machine + .int 1 # e_version + .int LOAD_PHYSICAL_ADDR # e_entry + .int phdr - bootsect_start # e_phoff + .int 0 # e_shoff + .int 0 # e_flags + .word e_ehdr - ehdr # e_ehsize + .word e_phdr1 - phdr # e_phentsize + .word (e_phdr - phdr)/(e_phdr1 - phdr) # e_phnum + .word 40 # e_shentsize + .word 0 # e_shnum + .word 0 # e_shstrndx +e_ehdr: + + .org 71 +normalize: # Normalize the start address ljmp...
2007 Apr 18
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...inaries 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 =3D 1; i < hdr->e_shnum; i++) { + if (!(sechdrs[i].sh_flags & SHF_ALLOC)) + continue; + + sechdrs[i].sh_addr +=3D VSYSCALL_RELOCATION; + if (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3...
2007 Apr 18
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...inaries 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 =3D 1; i < hdr->e_shnum; i++) { + if (!(sechdrs[i].sh_flags & SHF_ALLOC)) + continue; + + sechdrs[i].sh_addr +=3D VSYSCALL_RELOCATION; + if (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...atic u32 map_elf(int elf_fd, const Elf i, addr, (void *)phdr[i].p_paddr, &phdr[i].p_paddr); } - *pgdir_addr = finish(mem, page_offset, initrd, ird_size); + /* Now process sections searching for boot page tables + * Start by finding the symtab section */ + if (lseek(elf_fd, ehdr->e_shoff, SEEK_SET) < 0) + err(1, "Seeking to section headers"); + if (read(elf_fd, sec, sizeof(sec)) != sizeof(sec)) + err(1, "Reading section headers"); + + for (i = 0; i < ehdr->e_shnum; i++) { + if (sec[i].sh_type == SHT_SYMTAB) { + int ret = 0; + syms = malloc(sec[i]...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...atic u32 map_elf(int elf_fd, const Elf i, addr, (void *)phdr[i].p_paddr, &phdr[i].p_paddr); } - *pgdir_addr = finish(mem, page_offset, initrd, ird_size); + /* Now process sections searching for boot page tables + * Start by finding the symtab section */ + if (lseek(elf_fd, ehdr->e_shoff, SEEK_SET) < 0) + err(1, "Seeking to section headers"); + if (read(elf_fd, sec, sizeof(sec)) != sizeof(sec)) + err(1, "Reading section headers"); + + for (i = 0; i < ehdr->e_shnum; i++) { + if (sec[i].sh_type == SHT_SYMTAB) { + int ret = 0; + syms = malloc(sec[i]...
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 --