Message ID | 20170822180214.31800-1-gftg@linux.vnet.ibm.com |
---|---|
State | Committed |
Delegated to: | Joseph Myers |
Headers |
Received: (qmail 106214 invoked by alias); 22 Aug 2017 18:02:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 106194 invoked by uid 89); 22 Aug 2017 18:02:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com> To: libc-alpha@sourceware.org Cc: msebor@gmail.com, joseph@codesourcery.com Subject: [PATCH] Fix remaining return type of ifunc resolver declaration Date: Tue, 22 Aug 2017 15:02:14 -0300 In-Reply-To: <f967b8f5-6802-f848-ba68-b1df8069d379@gmail.com> References: <f967b8f5-6802-f848-ba68-b1df8069d379@gmail.com> X-TM-AS-GCONF: 00 x-cbid: 17082218-0004-0000-0000-000012CF2EDA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007592; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000223; SDB=6.00906104; UDB=6.00454116; IPR=6.00686305; BA=6.00005550; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016814; XFM=3.00000015; UTC=2017-08-22 18:02:18 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17082218-0005-0000-0000-000080D09EE6 Message-Id: <20170822180214.31800-1-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-22_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708220276 |
Commit Message
Gabriel F T Gomes
Aug. 22, 2017, 6:02 p.m. UTC
Since Martin Sebor's commit commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2 Author: Martin Sebor <msebor@redhat.com> Date: Tue Aug 22 09:35:23 2017 -0600 Declare ifunc resolver to return a pointer to the same type as the target function to help GCC detect incompatibilities between the two when it's enhanced to do so. builds for powerpc64le fail in the declaration of some ifunc resolvers, because the ifunc is declared with unmatching return types. One of the declarations comes from the __ifunc_resolver macro, which was patched by the aforementioned commit: /* Helper / base macros for indirect function symbols. */ #define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \ classifier inhibit_stack_protector \ __typeof (type_name) *name##_ifunc (arg) \ whereas the other comes from the unpatched __ifunc macro when HAVE_GCC_IFUNC is not defined: # define __ifunc(type_name, name, expr, arg, init) \ extern __typeof (type_name) name; \ void *name##_ifunc (arg) __asm__ (#name); \ This patch changes the return type of the ifunc resolver in the __ifunc macro, so that it matches the return type of the target function, similarly to what the aforementioned commit does. Tested for powerpc64le and s390x with unpatched GCC. --- include/libc-symbols.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 08/22/2017 12:02 PM, Gabriel F. T. Gomes wrote: > Since Martin Sebor's commit > > commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2 > Author: Martin Sebor <msebor@redhat.com> > Date: Tue Aug 22 09:35:23 2017 -0600 > > Declare ifunc resolver to return a pointer to the same type as the target > function to help GCC detect incompatibilities between the two when it's > enhanced to do so. > > builds for powerpc64le fail in the declaration of some ifunc resolvers, > because the ifunc is declared with unmatching return types. One of the > declarations comes from the __ifunc_resolver macro, which was patched by > the aforementioned commit: > > /* Helper / base macros for indirect function symbols. */ > #define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \ > classifier inhibit_stack_protector \ > __typeof (type_name) *name##_ifunc (arg) \ > > whereas the other comes from the unpatched __ifunc macro when > HAVE_GCC_IFUNC is not defined: > > # define __ifunc(type_name, name, expr, arg, init) \ > extern __typeof (type_name) name; \ > void *name##_ifunc (arg) __asm__ (#name); \ > > This patch changes the return type of the ifunc resolver in the __ifunc > macro, so that it matches the return type of the target function, > similarly to what the aforementioned commit does. Sorry about that and thanks for patching it up. I didn't think to check all the other __ifunc macros in the file for their uses of __ifunc_resolver. Martin > > Tested for powerpc64le and s390x with unpatched GCC. > --- > include/libc-symbols.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/libc-symbols.h b/include/libc-symbols.h > index 42fc41a1a5..65738caaa7 100644 > --- a/include/libc-symbols.h > +++ b/include/libc-symbols.h > @@ -831,7 +831,7 @@ for linking") > > # define __ifunc(type_name, name, expr, arg, init) \ > extern __typeof (type_name) name; \ > - void *name##_ifunc (arg) __asm__ (#name); \ > + extern __typeof (type_name) *name##_ifunc (arg) __asm__ (#name); \ > __ifunc_resolver (type_name, name, expr, arg, init,) \ > __asm__ (".type " #name ", %gnu_indirect_function"); > >
On Tue, 22 Aug 2017, Gabriel F. T. Gomes wrote: > This patch changes the return type of the ifunc resolver in the __ifunc > macro, so that it matches the return type of the target function, > similarly to what the aforementioned commit does. Thanks, please commit (with ChangeLog entry).
On Tue, 22 Aug 2017 20:13:45 +0000 Joseph Myers <joseph@codesourcery.com> wrote: >On Tue, 22 Aug 2017, Gabriel F. T. Gomes wrote: > >> This patch changes the return type of the ifunc resolver in the __ifunc >> macro, so that it matches the return type of the target function, >> similarly to what the aforementioned commit does. > >Thanks, please commit (with ChangeLog entry). Thank you, Martin and Joseph. I've committed this patch with the ChangeLog entry.
diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 42fc41a1a5..65738caaa7 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -831,7 +831,7 @@ for linking") # define __ifunc(type_name, name, expr, arg, init) \ extern __typeof (type_name) name; \ - void *name##_ifunc (arg) __asm__ (#name); \ + extern __typeof (type_name) *name##_ifunc (arg) __asm__ (#name); \ __ifunc_resolver (type_name, name, expr, arg, init,) \ __asm__ (".type " #name ", %gnu_indirect_function");