search for: e_shstrndx

Displaying 20 results from an estimated 35 matches for "e_shstrndx".

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
2013 Dec 01
0
[PATCH v2 4/4] efi: PE file size differ from in-memory size
...amp;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 +210,9 @@ int main(int argc, char **argv) fread((void *)&a...
2013 Nov 27
0
[PATCH 4/4] efi: PE file size differ from in-memory size
...amp;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 +206,9 @@ int main(int argc, char **argv) fread((void *)&a...
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...+ if (!addr) { + error("Failed to map symbol table\n"); + return NULL; + } + + mbinfo.flags |= MB_INFO_ELF_SHDR; + mbinfo.syms.e.addr = addr; + mbinfo.syms.e.num = eh64->e_shnum; + mbinfo.syms.e.size = eh64->e_shentsize; + mbinfo.syms.e.shndx = eh64->e_shstrndx; + + for (i = 0; i < eh64->e_shnum; i++) { + addr_t align; + + if (!sh64[i].sh_size) + continue; /* Empty section */ + if (sh64[i].sh_flags & SHF_ALLOC) + continue; /* SHF_ALLOC sections should have PHDRs */ + + align = sh64[i].sh_addralign ? sh64[i].sh_addralign : 0; +...
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 May 31
1
[patch rfc wip] first cut of ELF bzImage
...L_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 $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 |...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...L_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 $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 |...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...ion */ + 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 0) { + Elf32_Sym *sym =3D (void *)hdr + sechdrs[i].sh_o...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...ion */ + 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 0) { + Elf32_Sym *sym =3D (void *)hdr + sechdrs[i].sh_o...
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 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 Jun 06
7
[PATCH RFC 0/7] proposed updates to boot protocol and paravirt booting
This series: 1. Updates the boot protocol to version 2.07 2. Clean up the existing build process, to get rid of tools/build and make the linker do more heavy lifting 3. Make the bzImage payload an ELF file. The bootloader can extract this as a naked ELF file by skipping over boot_params.setup_sects worth of 16-bit setup code. 4. Update the boot_params to 2.07, and update the
2007 Jun 06
7
[PATCH RFC 0/7] proposed updates to boot protocol and paravirt booting
This series: 1. Updates the boot protocol to version 2.07 2. Clean up the existing build process, to get rid of tools/build and make the linker do more heavy lifting 3. Make the bzImage payload an ELF file. The bootloader can extract this as a naked ELF file by skipping over boot_params.setup_sects worth of 16-bit setup code. 4. Update the boot_params to 2.07, and update the
2017 Oct 04
1
[PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure
...module *me) { - const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL, - *para = NULL, *orc = NULL, *orc_ip = NULL; + const Elf_Shdr *s, *text = NULL, *alt = NULL, *pv_alt = NULL, + *locks = NULL, *para = NULL, *orc = NULL, *orc_ip = NULL; char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { @@ -222,6 +222,8 @@ int module_finalize(const Elf_Ehdr *hdr, text = s; if (!strcmp(".altinstructions", secstrings + s->sh_name)) alt = s; + if (!strcmp(".pv_altinstructions", secstrings + s...
2007 Apr 18
1
[PATCH] (with benchmarks) binary patching of paravirt_ops call sites
...@@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL; + const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL, + *para = NULL; char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { @@ -118,6 +119,8 @@ int module_finalize(const Elf_Ehdr *hdr, alt = s; if (!strcmp(".smp_locks", secstrings + s->sh_name)) locks= s; + if (!strcmp(".parainstructions", secstrings + s->sh...
2007 Apr 18
1
[PATCH] (with benchmarks) binary patching of paravirt_ops call sites
...@@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL; + const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL, + *para = NULL; char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { @@ -118,6 +119,8 @@ int module_finalize(const Elf_Ehdr *hdr, alt = s; if (!strcmp(".smp_locks", secstrings + s->sh_name)) locks= s; + if (!strcmp(".parainstructions", secstrings + s->sh...
2007 Jun 01
2
another RFC patch: bzImage with ELF payload
...symbol */ Elf64_Xword st_size; /* Associated symbol size */ }; - +#endif /* __ASSEMBLY__ */ #define EI_NIDENT 16 +#ifndef __ASSEMBLY__ struct elf32_hdr { unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; @@ -223,6 +229,7 @@ struct elf64_hdr { Elf64_Half e_shnum; Elf64_Half e_shstrndx; }; +#endif /* __ASSEMBLY__ */ /* These constants define the permissions on sections in the program header, p_flags. */ @@ -230,6 +237,7 @@ struct elf64_hdr { #define PF_W 0x2 #define PF_X 0x1 +#ifndef __ASSEMBLY__ struct elf32_phdr { Elf32_Word p_type; Elf32_Off p_offset; @@ -...
2007 Jun 01
2
another RFC patch: bzImage with ELF payload
...symbol */ Elf64_Xword st_size; /* Associated symbol size */ }; - +#endif /* __ASSEMBLY__ */ #define EI_NIDENT 16 +#ifndef __ASSEMBLY__ struct elf32_hdr { unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; @@ -223,6 +229,7 @@ struct elf64_hdr { Elf64_Half e_shnum; Elf64_Half e_shstrndx; }; +#endif /* __ASSEMBLY__ */ /* These constants define the permissions on sections in the program header, p_flags. */ @@ -230,6 +237,7 @@ struct elf64_hdr { #define PF_W 0x2 #define PF_X 0x1 +#ifndef __ASSEMBLY__ struct elf32_phdr { Elf32_Word p_type; Elf32_Off p_offset; @@ -...
2007 Apr 18
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...+ 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") =3D=3D 0) { + Elf32_Sym *sym =3D (void *)hdr + sechdrs[i]...