search for: elf64_sym

Displaying 20 results from an estimated 31 matches for "elf64_sym".

Did you mean: elf32_sym
2018 May 23
0
[PATCH v3 23/27] x86/modules: Adapt module loading for PIE support
...linux/jump_label.h> #include <linux/random.h> +#include <linux/sort.h> #include <asm/text-patching.h> #include <asm/page.h> @@ -77,6 +78,173 @@ static unsigned long int get_module_load_offset(void) } #endif +#ifdef CONFIG_X86_PIE +static u64 find_got_kernel_entry(Elf64_Sym *sym, const Elf64_Rela *rela) +{ + u64 *pos; + + for (pos = (u64*)__start_got; pos < (u64*)__end_got; pos++) { + if (*pos == sym->st_value) + return (u64)pos + rela->r_addend; + } + + return 0; +} + +static u64 module_emit_got_entry(struct module *mod, void *loc, + const Elf64_Rela...
2019 Apr 30
3
RFC - a proposal to support additional symbol metadata in ELF object files in the ARM compiler
...har st_info; unsigned char st_other; Elf32_Half st_shndx; } Elf32_Sym; typedef struct { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } Elf64_Sym; The st_size and st_value fields could be used to represent attribute information about a given symbol: * The st_size field can be split into an attribute ID and a symbol index for the symbol that the attribute applies to * attribute ID: bits 0..7 * symbol index: bits 8..31 *...
2019 Apr 30
3
[EXTERNAL] Re: RFC - a proposal to support additional symbol metadata in ELF object files in the ARM compiler
...; > > > > typedef struct { > > Elf64_Word st_name; > > unsigned char st_info; > > unsigned char st_other; > > Elf64_Half st_shndx; > > Elf64_Addr st_value; > > Elf64_Xword st_size; > > } Elf64_Sym; > > > > The st_size and st_value fields could be used to represent attribute information about a given symbol: > > > > The st_size field can be split into an attribute ID and a symbol index for the symbol that the attribute applies to > > attribute ID: bits 0..7 >...
2019 May 01
2
RFC - a proposal to support additional symbol metadata in ELF object files in the ARM compiler
...Elf64_Word st_name; > > unsigned char st_info; > > unsigned char st_other; > > Elf64_Half st_shndx; > > Elf64_Addr st_value; > > Elf64_Xword st_size; > > } Elf64_Sym; > > > > The st_size and st_value fields could be used to represent attribute information about a given symbol: > > > > The st_size field can be split into an attribute ID and a symbol index for the symbol that the attribute applies to &gt...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...e ELF32_R_SYM(x) ((x) >> 8) @@ -146,6 +150,7 @@ typedef struct { #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) +#ifndef __ASSEMBLY__ typedef struct elf32_rel { Elf32_Addr r_offset; Elf32_Word r_info; @@ -185,10 +190,11 @@ typedef struct elf64_sym { Elf64_Addr st_value; /* Value of the symbol */ Elf64_Xword st_size; /* Associated symbol size */ } Elf64_Sym; - +#endif /* __ASSEMBLY__ */ #define EI_NIDENT 16 +#ifndef __ASSEMBLY__ typedef struct elf32_hdr{ unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; @@ -222,6 +228,...
2007 May 31
1
[patch rfc wip] first cut of ELF bzImage
...e ELF32_R_SYM(x) ((x) >> 8) @@ -146,6 +150,7 @@ typedef struct { #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) +#ifndef __ASSEMBLY__ typedef struct elf32_rel { Elf32_Addr r_offset; Elf32_Word r_info; @@ -185,10 +190,11 @@ typedef struct elf64_sym { Elf64_Addr st_value; /* Value of the symbol */ Elf64_Xword st_size; /* Associated symbol size */ } Elf64_Sym; - +#endif /* __ASSEMBLY__ */ #define EI_NIDENT 16 +#ifndef __ASSEMBLY__ typedef struct elf32_hdr{ unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; @@ -222,6 +228,...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...lf_fd, const Elf64_Ehdr *ehdr, unsigned long mem, + unsigned long *pgdir_addr, + const char *initrd, unsigned long *ird_size, + unsigned long *page_offset) +{ +#ifdef CONFIG_X86_64 + void *addr; + Elf64_Phdr phdr[ehdr->e_phnum]; + unsigned int i; + Elf64_Shdr sec[ehdr->e_shnum]; + Elf64_Sym *syms; + char *strtab = NULL; + unsigned long nsyms = 0; + + /* Sanity checks. */ + if (ehdr->e_type != ET_EXEC + || ehdr->e_machine != EM_X86_64 + || ehdr->e_phentsize != sizeof(Elf64_Phdr) + || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf64_Phdr)) + err...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...lf_fd, const Elf64_Ehdr *ehdr, unsigned long mem, + unsigned long *pgdir_addr, + const char *initrd, unsigned long *ird_size, + unsigned long *page_offset) +{ +#ifdef CONFIG_X86_64 + void *addr; + Elf64_Phdr phdr[ehdr->e_phnum]; + unsigned int i; + Elf64_Shdr sec[ehdr->e_shnum]; + Elf64_Sym *syms; + char *strtab = NULL; + unsigned long nsyms = 0; + + /* Sanity checks. */ + if (ehdr->e_type != ET_EXEC + || ehdr->e_machine != EM_X86_64 + || ehdr->e_phentsize != sizeof(Elf64_Phdr) + || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf64_Phdr)) + err...
2007 Dec 10
1
[git patch] m-i-t support, ipconfig fix
.../* _SYS_ELF32_H */ diff --git a/usr/include/sys/elf64.h b/usr/include/sys/elf64.h index 0b486ac..877b7cd 100644 --- a/usr/include/sys/elf64.h +++ b/usr/include/sys/elf64.h @@ -110,4 +110,8 @@ typedef struct elf64_note { Elf64_Word n_type; /* Content type */ } Elf64_Nhdr; +/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */ +#define ELF64_ST_BIND(val) ELF32_ST_BIND (val) +#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) + #endif /* _SYS_ELF64_H */ diff --git a/usr/include/sys/elfcommon.h b/usr/include/sys/elfcommon.h index 0d81db5..ad5e459 100644 --- a/usr/include/sys/elfco...
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
2019 May 01
4
RFC - a proposal to support additional symbol metadata in ELF object files in the ARM compiler
...> > > unsigned char st_other; > > > > > > Elf64_Half st_shndx; > > > > > > Elf64_Addr st_value; > > > > > > Elf64_Xword st_size; > > > > > > } Elf64_Sym; > > > > > > > > > > > > The st_size and st_value fields could be used to represent attribute information about a given symbol: > > > > > > > > > > > > The st_size field can be split into an attr...
2007 Sep 22
3
[git patch] module-init-tools fixes
.../* _SYS_ELF32_H */ diff --git a/usr/include/sys/elf64.h b/usr/include/sys/elf64.h index 0b486ac..877b7cd 100644 --- a/usr/include/sys/elf64.h +++ b/usr/include/sys/elf64.h @@ -110,4 +110,8 @@ typedef struct elf64_note { Elf64_Word n_type; /* Content type */ } Elf64_Nhdr; +/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */ +#define ELF64_ST_BIND(val) ELF32_ST_BIND (val) +#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) + #endif /* _SYS_ELF64_H */ diff --git a/usr/include/sys/elfcommon.h b/usr/include/sys/elfcommon.h index 0d81db5..ad5e459 100644 --- a/usr/include/sys/elfco...
2019 May 06
2
[EXTERNAL] Re: RFC - a proposal to support additional symbol metadata in ELF object files in the ARM compiler
...> > > unsigned char st_other; > > > > > > Elf64_Half st_shndx; > > > > > > Elf64_Addr st_value; > > > > > > Elf64_Xword st_size; > > > > > > } Elf64_Sym; > > > > > > > > > > > > The st_size and st_value fields could be used to represent attribute information about a given symbol: > > > > > > > > > > > > The st_size field can be split into an attr...
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
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
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
2007 Jun 01
2
another RFC patch: bzImage with ELF payload
...ons */ #define ELF32_R_SYM(x) ((x) >> 8) @@ -147,6 +151,7 @@ struct elf64_dyn { #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) +#ifndef __ASSEMBLY__ struct elf32_rel { Elf32_Addr r_offset; Elf32_Word r_info; @@ -186,10 +191,11 @@ struct elf64_sym { Elf64_Addr st_value; /* Value of the 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...
2007 Jun 01
2
another RFC patch: bzImage with ELF payload
...ons */ #define ELF32_R_SYM(x) ((x) >> 8) @@ -147,6 +151,7 @@ struct elf64_dyn { #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) +#ifndef __ASSEMBLY__ struct elf32_rel { Elf32_Addr r_offset; Elf32_Word r_info; @@ -186,10 +191,11 @@ struct elf64_sym { Elf64_Addr st_value; /* Value of the 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...
2017 Oct 04
28
x86: PIE support and option to extend KASLR randomization
These patches make the changes necessary to build the kernel as Position Independent Executable (PIE) on x86_64. A PIE kernel can be relocated below the top 2G of the virtual address space. It allows to optionally extend the KASLR randomization range from 1G to 3G. Thanks a lot to Ard Biesheuvel & Kees Cook on their feedback on compiler changes, PIE support and KASLR in general. Thanks to