search for: shn_undef

Displaying 20 results from an estimated 26 matches for "shn_undef".

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
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...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_offset; + n =3D sechdrs[i].sh_size / sizeof(*sym); + for (j =3D 1; j < n; j++) { + int ndx =3D sym[j].st_shndx; + if (ndx =3D=3D SHN_UNDEF || ndx =3D=3D SHN_ABS) + continue; + sym[j].st_value +=3D VDSO_HIGH_BASE; + } + } else if (strcmp(secstrings+sechdrs[i].sh_name, ".dynamic") =3D=3D 0) { + Elf32_Dyn *dyn =3D (void *)hdr + sechdrs[i].sh_offset; + int tag; + while ((tag =3D (++dyn)->d_tag) !=3D DT_NULL) +...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...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_offset; + n =3D sechdrs[i].sh_size / sizeof(*sym); + for (j =3D 1; j < n; j++) { + int ndx =3D sym[j].st_shndx; + if (ndx =3D=3D SHN_UNDEF || ndx =3D=3D SHN_ABS) + continue; + sym[j].st_value +=3D VDSO_HIGH_BASE; + } + } else if (strcmp(secstrings+sechdrs[i].sh_name, ".dynamic") =3D=3D 0) { + Elf32_Dyn *dyn =3D (void *)hdr + sechdrs[i].sh_offset; + int tag; + while ((tag =3D (++dyn)->d_tag) !=3D DT_NULL) +...
2018 May 23
0
[PATCH v3 23/27] x86/modules: Adapt module loading for PIE support
...If a _GLOBAL_OFFSET_TABLE_ symbol exists, make it absolute for + * modules to correctly reference it. Similar to s390 implementation. + */ + strings = (void *) ehdr + sechdrs[symtab->sh_link].sh_offset; + for (i = 0; i < symtab->sh_size/sizeof(Elf_Sym); i++) { + if (syms[i].st_shndx != SHN_UNDEF) + continue; + name = strings + syms[i].st_name; + if (!strcmp(name, "_GLOBAL_OFFSET_TABLE_")) { + syms[i].st_shndx = SHN_ABS; + break; + } + } + return 0; +} +#endif + void *module_alloc(unsigned long size) { void *p; @@ -190,16 +358,20 @@ int apply_relocate_add(Elf64_Shdr *...
2013 Dec 01
0
[PATCH v2 4/4] efi: PE file size differ from in-memory size
...= e64_hdr.e_phoff; + phnum = e64_hdr.e_phnum; + phentsize = e64_hdr.e_phentsize; } else { fprintf(stderr, "Unsupported architecture\n"); exit(EXIT_FAILURE); @@ -234,98 +226,47 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - if (!shoff || !shnum || (shstrndx == SHN_UNDEF)) { - fprintf(stderr, "Cannot find section table\n"); + if (!phoff || !phnum) { + fprintf(stderr, "Cannot find segment table\n"); exit(EXIT_FAILURE); } /* - * Find the beginning of the .bss section. Everything preceding - * it is copied verbatim to the output file....
2013 Nov 27
0
[PATCH 4/4] efi: PE file size differ from in-memory size
...= e64_hdr.e_phoff; + phnum = e64_hdr.e_phnum; + phentsize = e64_hdr.e_phentsize; } else { fprintf(stderr, "Unsupported architecture\n"); exit(EXIT_FAILURE); @@ -230,98 +222,47 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - if (!shoff || !shnum || (shstrndx == SHN_UNDEF)) { - fprintf(stderr, "Cannot find section table\n"); + if (!phoff || !phnum) { + fprintf(stderr, "Cannot find segment table\n"); exit(EXIT_FAILURE); } /* - * Find the beginning of the .bss section. Everything preceding - * it is copied verbatim to the output file....
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.
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
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...+=3D VSYSCALL_RELOCATION; + if (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3D=3D 0) { + Elf32_Sym *sym =3D (void *)hdr + sechdrs[i].sh_offset; + n =3D sechdrs[i].sh_size / sizeof(*sym); + for (j =3D 1; j < n; j++) { + int ndx =3D sym[j].st_shndx; + if (ndx =3D=3D SHN_UNDEF || ndx =3D=3D SHN_ABS) + continue; + sym[j].st_value +=3D VSYSCALL_RELOCATION; + } + } else if (strcmp(secstrings+sechdrs[i].sh_name, ".dynamic") =3D=3D 0) { + Elf32_Dyn *dyn =3D (void *)hdr + sechdrs[i].sh_offset; + int tag; + while ((tag =3D (++dyn)->d_tag) !=3D DT_NU...
2007 Apr 18
1
[PATCH, experimental] i386 Allow the fixmap to be relocated at boot time
...+=3D VSYSCALL_RELOCATION; + if (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3D=3D 0) { + Elf32_Sym *sym =3D (void *)hdr + sechdrs[i].sh_offset; + n =3D sechdrs[i].sh_size / sizeof(*sym); + for (j =3D 1; j < n; j++) { + int ndx =3D sym[j].st_shndx; + if (ndx =3D=3D SHN_UNDEF || ndx =3D=3D SHN_ABS) + continue; + sym[j].st_value +=3D VSYSCALL_RELOCATION; + } + } else if (strcmp(secstrings+sechdrs[i].sh_name, ".dynamic") =3D=3D 0) { + Elf32_Dyn *dyn =3D (void *)hdr + sechdrs[i].sh_offset; + int tag; + while ((tag =3D (++dyn)->d_tag) !=3D DT_NU...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...d(elf_fd, strtab, sec[sec[i].sh_link].sh_size); + if (ret != sec[sec[i].sh_link].sh_size) + err(1, "Reading string table"); + break; + } + } + + /* We now have a pointer to the symtab, start searching for the symbol */ + for (i = 0; i < nsyms; i++) { + if ((syms[i].st_shndx == SHN_UNDEF) || !syms[i].st_name) + continue; + if (!strcmp("boot_level4_pgt", + (char *)((u64)syms[i].st_name + strtab))) { + *pgdir_addr = syms[i].st_value - *page_offset; + break; + } + } + + if (!*pgdir_addr) + err(1,"Unable to find boot pgdir"); + + *ird_size = load_initrd(...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...d(elf_fd, strtab, sec[sec[i].sh_link].sh_size); + if (ret != sec[sec[i].sh_link].sh_size) + err(1, "Reading string table"); + break; + } + } + + /* We now have a pointer to the symtab, start searching for the symbol */ + for (i = 0; i < nsyms; i++) { + if ((syms[i].st_shndx == SHN_UNDEF) || !syms[i].st_name) + continue; + if (!strcmp("boot_level4_pgt", + (char *)((u64)syms[i].st_name + strtab))) { + *pgdir_addr = syms[i].st_value - *page_offset; + break; + } + } + + if (!*pgdir_addr) + err(1,"Unable to find boot pgdir"); + + *ird_size = load_initrd(...
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 --
2012 Jul 16
5
[PATCH 0/5] Deleting __intcall() from Syslinux
From: Matt Fleming <matt.fleming at intel.com> Since we can't use __intcall() for EFI, and since we can now have the ELF module code resolve all our symbols at runtime, we should delete as many references to __intcall() as possible and just access the symbols directly. The most interesting patch is the support for weak symbols. We need to be able to reference derivative-specific
2012 Aug 14
1
[GIT PULL] elflink fixes
...crt_name = module->str_table + crt_sym->st_name; strong_count = 0; - weak_count = 0; + weak_count = (ELF32_ST_BIND(crt_sym->st_info) == STB_WEAK); for_each_module(crt_module) { @@ -345,6 +345,14 @@ int check_symbols(struct elf_module *module) if (crt_sym->st_shndx == SHN_UNDEF) { // We have an undefined symbol + // + // We use the weak_count to differentiate + // between Syslinux-derivative-specific + // functions. For example, unload_pxe() is + // only provided by PXELINUX, so we mark it as + // __weak and replace it with a reference to + // undefin...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...d(elf_fd, strtab, sec[sec[i].sh_link].sh_size); + if (ret != sec[sec[i].sh_link].sh_size) + err(1, "Reading string table"); + break; + } + } + + /* We now have a pointer to the symtab, start searching for the symbol */ + for (i = 0; i < nsyms; i++) { + if ((syms[i].st_shndx == SHN_UNDEF) || !syms[i].st_name) + continue; + if (!strcmp("boot_level4_pgt", + (char *)((u64)syms[i].st_name + strtab))) { + *pgdir_addr = syms[i].st_value - *page_offset; + break; + } + } + + if (!*pgdir_addr) + err(1,"Unable to find boot pgdir"); + + *ird_size = load_initrd(...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...d(elf_fd, strtab, sec[sec[i].sh_link].sh_size); + if (ret != sec[sec[i].sh_link].sh_size) + err(1, "Reading string table"); + break; + } + } + + /* We now have a pointer to the symtab, start searching for the symbol */ + for (i = 0; i < nsyms; i++) { + if ((syms[i].st_shndx == SHN_UNDEF) || !syms[i].st_name) + continue; + if (!strcmp("boot_level4_pgt", + (char *)((u64)syms[i].st_name + strtab))) { + *pgdir_addr = syms[i].st_value - *page_offset; + break; + } + } + + if (!*pgdir_addr) + err(1,"Unable to find boot pgdir"); + + *ird_size = load_initrd(...
2018 Mar 13
32
[PATCH v2 00/27] x86: PIE support and option to extend KASLR randomization
Changes: - patch v2: - Adapt patch to work post KPTI and compiler changes - Redo all performance testing with latest configs and compilers - Simplify mov macro on PIE (MOVABS now) - Reduce GOT footprint - patch v1: - Simplify ftrace implementation. - Use gcc mstack-protector-guard-reg=%gs with PIE when possible. - rfc v3: - Use --emit-relocs instead of -pie to reduce