This is the mail archive of the libc-alpha@sourceware.org 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] HPPA/IA64 : Don't use broken DL_AUTO_FUNCTION_ADDRESS()


Guy Martin <gmsoft@tuxicoman.be> writes:

> diff --git a/elf/dl-close.c b/elf/dl-close.c
> index fe3014c..3735527 100644
> --- a/elf/dl-close.c
> +++ b/elf/dl-close.c
> @@ -274,9 +274,8 @@ _dl_close_worker (struct link_map *map)
>  
>  	      /* Next try the old-style destructor.  */
>  	      if (imap->l_info[DT_FINI] != NULL)
> -		(*(void (*) (void)) DL_DT_FINI_ADDRESS
> -		 (imap, ((void *) imap->l_addr
> -			 + imap->l_info[DT_FINI]->d_un.d_ptr))) ();
> +		DL_DT_FINI (imap, ((void *) imap->l_addr
> +			 + imap->l_info[DT_FINI]->d_un.d_ptr));

The macro should have CALL in its name.

> diff --git a/ports/sysdeps/hppa/dl-machine.h b/ports/sysdeps/hppa/dl-machine.h
> index d2411a6..b8587a5 100644
> --- a/ports/sysdeps/hppa/dl-machine.h
> +++ b/ports/sysdeps/hppa/dl-machine.h
> @@ -490,8 +490,12 @@ asm (									\
>  #define ELF_MACHINE_NO_REL 1
>  
>  /* Return the address of the entry point. */
> -#define ELF_MACHINE_START_ADDRESS(map, start) \
> -  DL_STATIC_FUNCTION_ADDRESS (map, start)
> +#define ELF_MACHINE_START_ADDRESS(map, start)		\
> +({							\
> +	ElfW(Addr) addr;				\
> +	static DL_DT_FUNCTION_ADDRESS(map, start, addr)	\

Please make static an argument of the macro.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


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