[CRIU] [PATCH 4/8] vdso: share the PIE part of the vDSO proxy machinery between all architectures

Cyrill Gorcunov gorcunov at gmail.com
Tue Mar 11 02:33:49 PDT 2014


On Mon, Mar 10, 2014 at 12:51:24PM +0400, Alexander Kartashov wrote:
> This patch splits the file arch/x86/vdso-pie.c into machine-dependent
> and machine-independent parts by moving the routines vdso_fill_symtable(),
> vdso_remap(), and vdso_proxify() to the file pie/vdso.c.
> 
> The ARM version of the routines is moved to the source pie/vdso-stub.c
> to provide the vDSO proxy stub implementation for architectures
> that don't provide the vDSO.
> 
> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> Cc: Cyrill Gorcunov <gorcunov at openvz.org>
...
> --- /dev/null
> +++ b/pie/vdso.c
> @@ -0,0 +1,272 @@
> +#include <elf.h>
> +
> +#include <sys/mman.h>
> +
...
> +int vdso_fill_symtable(char *mem, size_t size, struct vdso_symtable *t)
> +{
> +	Elf64_Ehdr *ehdr = (void *)mem;
> +	Elf64_Shdr *shdr, *shdr_strtab;
> +	Elf64_Shdr *shdr_dynsym;
> +	Elf64_Shdr *shdr_dynstr;
> +	Elf64_Phdr *phdr;
> +	Elf64_Shdr *text;
> +	Elf64_Sym *sym;
> +
> +	char *section_names, *dynsymbol_names;
> +
> +	unsigned long base = VDSO_BAD_ADDR;
> +	unsigned int i, j, k;
> +
> +	/*
> +	 * Elf header bytes. For detailed
> +	 * description see Elf specification.
> +	 */
> +	char vdso_ident[] = {
> +		0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00,
> +		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	};

This is architecture specific data, how this supposed to work on ARM?


More information about the CRIU mailing list