[PATCH] HPPA/IA64 : Don't use broken DL_AUTO_FUNCTION_ADDRESS()

Guy Martin gmsoft@tuxicoman.be
Wed Nov 6 12:54:00 GMT 2013


On 2013-10-31 14:39, Andreas Schwab wrote:
> 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.


The attached patch addresses the above issues. I also fixed warnings at 
compile time.
Tested on amd64 and hppa. Untested on ia64.


Regards,
   Guy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-2.17-fix-DL_AUTO_FUNCTION_ADDRESS-v2.patch
Type: text/x-patch
Size: 8840 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20131106/28517662/attachment.bin>


More information about the Libc-alpha mailing list