From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81995 invoked by alias); 22 Aug 2017 18:54:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 81981 invoked by uid 89); 22 Aug 2017 18:54:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f180.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tkad1iVAN/ZqcJe6ajGVK7Uuw7cXlUcgkHdZTO3HLRQ=; b=lolNNd2dKUkJPB3/ZxTImQCrqeB6WSAo+pTnsjzFoA/Onmxot4bcHldoUa7wd+R70n xuoVIT0SE0r0V90Frlj0gjiz+VhLbzUm5KIO+Xwwt+T3HimAY8z+agF9TUmAN8mOHsCV KKZ4Vt+briVEptW4yec2k0ol28Haqr4zQjARl0HUPBRAzYEiJGm4HKBIRpzKdKkiqy60 KpGEhjYxZRJ9+G5PK+3+qSgf8DLqEnXXGZgI6nCrUGn0xQHliNNOZzFbNEAhLSjTudPM fLzVuIWypZWQYsdcJ/rlowYfXjO2BnWwTcck+c4fQVFuhr0sLGXEQ8m52X+s9lv4tG2y hFdQ== X-Gm-Message-State: AHYfb5iEP3J5lVeUDWJz1SDg0Evxu4U4HwV7j9UJ/VR48NHgbh+KnRrA TSqGCmsPXrbyzz6F X-Received: by 10.237.53.221 with SMTP id d29mr113842qte.313.1503428067892; Tue, 22 Aug 2017 11:54:27 -0700 (PDT) Subject: Re: [PATCH] Fix remaining return type of ifunc resolver declaration To: "Gabriel F. T. Gomes" , libc-alpha@sourceware.org References: <20170822180214.31800-1-gftg@linux.vnet.ibm.com> Cc: joseph@codesourcery.com From: Martin Sebor Message-ID: Date: Tue, 22 Aug 2017 18:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170822180214.31800-1-gftg@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-08/txt/msg01088.txt.bz2 On 08/22/2017 12:02 PM, Gabriel F. T. Gomes wrote: > Since Martin Sebor's commit > > commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2 > Author: Martin Sebor > 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"); > >