From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24110 invoked by alias); 25 May 2012 17:44:32 -0000 Received: (qmail 24094 invoked by uid 22791); 25 May 2012 17:44:30 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_HW X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 17:44:15 +0000 Received: by vbbey12 with SMTP id ey12so1040114vbb.0 for ; Fri, 25 May 2012 10:44:14 -0700 (PDT) Received: by 10.220.154.201 with SMTP id p9mr4543602vcw.36.1337967854197; Fri, 25 May 2012 10:44:14 -0700 (PDT) Received: from pebble.twiddle.net ([173.160.232.49]) by mx.google.com with ESMTPS id d20sm5182379vde.20.2012.05.25.10.44.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 May 2012 10:44:13 -0700 (PDT) Message-ID: <4FBFC4EC.1060209@twiddle.net> Date: Fri, 25 May 2012 17:44:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: libc-alpha@sourceware.org, libc-ports@sourceware.org Subject: Include hwcap as ifunc argument References: <4FBA744A.6000702@twiddle.net> In-Reply-To: <4FBA744A.6000702@twiddle.net> Content-Type: multipart/mixed; boundary="------------000909020503020205000800" X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00162.txt.bz2 This is a multi-part message in MIME format. --------------000909020503020205000800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 64 Committed as follows, after re-testing on arm, ppc[32/64]. r~ --------------000909020503020205000800 Content-Type: text/plain; charset=UTF-8; name="z1" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="z1" Content-length: 1686 * sysdeps/arm/dl-irel.h (elf_ifunc_invoke): Pass dl_hwcap. * sysdeps/arm/dl-machine.h (elf_machine_rel): Use elf_ifunc_invoke. (elf_machine_rela): Likewise. diff --git a/sysdeps/arm/dl-irel.h b/sysdeps/arm/dl-irel.h index 5141031..5b1964e 100644 --- a/sysdeps/arm/dl-irel.h +++ b/sysdeps/arm/dl-irel.h @@ -29,7 +29,7 @@ static inline Elf32_Addr __attribute ((always_inline)) elf_ifunc_invoke (Elf32_Addr addr) { - return ((Elf32_Addr (*) (void)) (addr)) (); + return ((Elf32_Addr (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap)); } static inline void diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 58cf418..8d905e8 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -25,6 +25,7 @@ #include #include #include +#include #define CLEAR_CACHE(BEG,END) \ INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0) @@ -377,7 +378,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) && __builtin_expect (!skip_ifunc, 1)) - value = ((Elf32_Addr (*) (void)) value) (); + value = elf_ifunc_invoke (value); switch (r_type) { @@ -551,7 +552,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) && __builtin_expect (!skip_ifunc, 1)) - value = ((Elf32_Addr (*) (void)) value) (); + value = elf_ifunc_invoke (value); switch (r_type) { --------------000909020503020205000800 Content-Type: text/plain; charset=UTF-8; name="z2" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="z2" Content-length: 3723 * sysdeps/powerpc/powerpc32/dl-irel.h (elf_ifunc_invoke): Pass dl_hwcap to ifunc resolver. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Use elf_ifunc_invoke. * sysdeps/powerpc/powerpc64/dl-irel.h (elf_ifunc_invoke): Pass dl_hwcap to ifunc resolver. * sysdeps/powerpc/powerpc64/dl-machine.h (resolve_ifunc): Likewise. diff --git a/sysdeps/powerpc/powerpc32/dl-irel.h b/sysdeps/powerpc/powerpc32/dl-irel.h index c8e50ee..ebaf44a 100644 --- a/sysdeps/powerpc/powerpc32/dl-irel.h +++ b/sysdeps/powerpc/powerpc32/dl-irel.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF indirect relocation inline functions. PowerPC version. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,7 +29,7 @@ static inline Elf32_Addr __attribute ((always_inline)) elf_ifunc_invoke (Elf32_Addr addr) { - return ((Elf32_Addr (*) (void)) (addr)) (); + return ((Elf32_Addr (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap)); } static inline void diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h index 45868f5..3ae27a4 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.h +++ b/sysdeps/powerpc/powerpc32/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. PowerPC version. - Copyright (C) 1995-2003, 2005, 2006, 2011 Free Software Foundation, Inc. + Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,6 +23,7 @@ #include #include +#include /* Translate a processor specific dynamic tag to the index in l_info array. */ @@ -308,7 +309,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) && __builtin_expect (!skip_ifunc, 1)) - value = ((Elf32_Addr (*) (void)) value) (); + value = elf_ifunc_invoke (value); /* A small amount of code is duplicated here for speed. In libc, more than 90% of the relocs are R_PPC_RELATIVE; in the X11 shared diff --git a/sysdeps/powerpc/powerpc64/dl-irel.h b/sysdeps/powerpc/powerpc64/dl-irel.h index 7270275..ced0f3f 100644 --- a/sysdeps/powerpc/powerpc64/dl-irel.h +++ b/sysdeps/powerpc/powerpc64/dl-irel.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF indirect relocation inline functions. PowerPC64 version. - Copyright (C) 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -31,7 +31,7 @@ static inline Elf64_Addr __attribute ((always_inline)) elf_ifunc_invoke (Elf64_Addr addr) { - return ((Elf64_Addr (*) (void)) (addr)) (); + return ((Elf64_Addr (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap)); } static inline void diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h index a964a29..7c7d768 100644 --- a/sysdeps/powerpc/powerpc64/dl-machine.h +++ b/sysdeps/powerpc/powerpc64/dl-machine.h @@ -545,7 +545,7 @@ resolve_ifunc (Elf64_Addr value, value = (Elf64_Addr) &opd; } #endif - return ((Elf64_Addr (*) (void)) value) (); + return ((Elf64_Addr (*) (unsigned long int)) value) (GLRO(dl_hwcap)); } /* Perform the relocation specified by RELOC and SYM (which is fully --------------000909020503020205000800--