This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] HPPA/IA64 : Don't use broken DL_AUTO_FUNCTION_ADDRESS()
- From: Andreas Schwab <schwab at suse dot de>
- To: Guy Martin <gmsoft at tuxicoman dot be>
- Cc: Carlos O'Donell <carlos at redhat dot com>, Mike Frysinger <vapier at gentoo dot org>, libc-alpha at sourceware dot org
- Date: Thu, 07 Nov 2013 09:27:18 +0100
- Subject: Re: [PATCH] HPPA/IA64 : Don't use broken DL_AUTO_FUNCTION_ADDRESS()
- Authentication-results: sourceware.org; auth=none
- References: <20131017214754 dot 00555bf3 at dellete> <871u3ina5t dot fsf at igel dot home> <b42704e5527fa00f6e69cacd0d62c19d at tuxicoman dot be> <201310190206 dot 07506 dot vapier at gentoo dot org> <52631FA0 dot 5090403 at redhat dot com> <78728c2956beea68522df0d0e5f8d649 at tuxicoman dot be> <80a141633592ef9ba33d3217af3e9cef at tuxicoman dot be> <mvmy559wode dot fsf at hawking dot suse dot de> <bc4d5a1387269aaa45585cd4c706e456 at tuxicoman dot be>
Guy Martin <gmsoft@tuxicoman.be> writes:
> diff --git a/elf/dl-close.c b/elf/dl-close.c
> index fe3014c..78c6dcc 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_CALL_FINI (imap, ((void *) imap->l_addr
> + + imap->l_info[DT_FINI]->d_un.d_ptr));
DL_CALL_DT_FINI whould be a more logical name.
> diff --git a/ports/sysdeps/ia64/dl-lookupcfg.h b/ports/sysdeps/ia64/dl-lookupcfg.h
> index 4da1263..323623d 100644
> --- a/ports/sysdeps/ia64/dl-lookupcfg.h
> +++ b/ports/sysdeps/ia64/dl-lookupcfg.h
> @@ -39,24 +39,29 @@ extern void _dl_unmap (struct link_map *map);
>
> #define DL_UNMAP(map) _dl_unmap (map)
>
> -#define DL_AUTO_FUNCTION_ADDRESS(map, addr) \
> -({ \
> - unsigned long int fptr[2]; \
> - fptr[0] = (unsigned long int) (addr); \
> - fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
> - (Elf64_Addr) fptr; \
> -})
> -
> -#define DL_STATIC_FUNCTION_ADDRESS(map, addr) \
> -({ \
> - static unsigned long int fptr[2]; \
> - fptr[0] = (unsigned long int) (addr); \
> - fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
> - (Elf64_Addr) fptr; \
> -})
> -
> -#define DL_DT_INIT_ADDRESS(map, addr) DL_AUTO_FUNCTION_ADDRESS (map, addr)
> -#define DL_DT_FINI_ADDRESS(map, addr) DL_AUTO_FUNCTION_ADDRESS (map, addr)
> +#define DL_DT_FUNCTION_ADDRESS(map, start, attr, addr) \
> + attr volatile unsigned int fptr[2]; \
> + fptr[0] = (unsigned int) (start); \
> + fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
> + /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \
> + addr = (ElfW(Addr))((unsigned int)fptr | 2); \
That can't be correct.
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."