This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ppc vdso, A working gettimeofday


Steve Munroe wrote:

> +    _dl_vdso_sym; _dl_vdso_vsym;

There is no reason to add these symbols anywhere but ppc/linux.  Despite
what you might want to believe, ppc/linux is not the only platform that
matters.


> diff -urN libc24-cvstip-20050427/elf/dl-vdso.c libc24/elf/dl-vdso.c
> --- libc24-cvstip-20050427/elf/dl-vdso.c	Wed Dec 31 18:00:00 1969
> +++ libc24/elf/dl-vdso.c	Thu Apr 28 17:26:43 2005
> @@ -0,0 +1,85 @@

Likewise for this file.  Move in specific directory.


> +	const ElfW(Sym) *ref = NULL;
> +	struct link_map *map = GLRO(dl_sysinfo_map);
> +	void *value = NULL;
> +	lookup_t result;
> +
> +	if (map != NULL )
> +	{
> +		/* Search the scope of the given vdso map.  */
> +		result = GLRO(dl_lookup_symbol_x) (name, map, &ref,

Haven't you paid any attention to the coding standard in all this time?
 Fix the indentation.



> diff -urN libc24-cvstip-20050427/elf/rtld.c libc24/elf/rtld.c
> --- libc24-cvstip-20050427/elf/rtld.c	2005-04-07 15:56:48.000000000 -0500
> +++ libc24/elf/rtld.c	2005-04-27 15:52:25.000000000 -0500
> @@ -1274,6 +1274,13 @@
>  	  elf_get_dynamic_info (l, dyn_temp);
>  	  _dl_setup_hash (l);
>  	  l->l_relocated = 1;
> +	  /* Initialize l_local_scope to contain just this map. This allows 
> +	     the use of dl_lookup_symbol_x to resolve symbols within the vdso.
> +	     So we create a single entry list pointing to l_real as its only
> +	     element */
> +	  
> +	  l->l_local_scope[0]->r_nlist = 1;
> +	  l->l_local_scope[0]->r_list = &l->l_real;

They is this needed?


>  
>  	  /* Now that we have the info handy, use the DSO image's soname
>  	     so this object can be looked up by name.  Note that we do not
> diff -urN libc24-cvstip-20050427/sysdeps/powerpc/elf/libc-start.c libc24/sysdeps/powerpc/elf/libc-start.c
> --- libc24-cvstip-20050427/sysdeps/powerpc/elf/libc-start.c	2004-04-03 19:06:07.000000000 -0600
> +++ libc24/sysdeps/powerpc/elf/libc-start.c	2005-04-29 15:48:44.000000000 -0500
> @@ -18,6 +18,7 @@
>  [...]
> +#ifdef SHARED
> +#undef __gettimeofday
> +#include <bits/libc-vdso.h>
> +
> +__typeof (__gettimeofday) *__vdso_gettimeofday attribute_hidden;
> +
> +#if __WORDSIZE == 64
> +typedef struct
> +	{
> +		void	*func;
> +		void	*toc_ptr;
> +		void	*extra;
> +	} _ppc_func_desciptor;
> +	
> +static struct
> +	{
> +		_ppc_func_desciptor	fd_gettimeofday;
> +	} __vdso_descriptor;
> +#endif

That's ppc/linux specific and doesn't have any business being in this file.


> --- libc24-cvstip-20050427/sysdeps/unix/sysv/linux/Makefile	2004-10-04 18:29:06.000000000 -0500
> +++ libc24/sysdeps/unix/sysv/linux/Makefile	2005-04-28 16:32:00.000000000 -0500
> @@ -142,6 +142,7 @@
>  
>  ifeq ($(subdir),elf)
>  sysdep-rtld-routines += dl-brk dl-sbrk
> +routines += dl-vdso

Once again, wrong file.

-- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]