From patchwork Wed Aug 24 14:04:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 14901 Received: (qmail 76905 invoked by alias); 24 Aug 2016 14:05:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 76781 invoked by uid 89); 24 Aug 2016 14:05:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=damage, *res, 2.3.0, arglist X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: stli@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org From: Stefan Liebler To: libc-alpha@sourceware.org Cc: stli@linux.vnet.ibm.com, fweimer@redhat.com, murphyp@linux.vnet.ibm.com, schwab@linux-m68k.org, joseph_myers@mentor.com Subject: [PATCH v3 6/9] Use libc_ifunc macro for clock_* symbols in librt. Date: Wed, 24 Aug 2016 16:04:29 +0200 In-Reply-To: <1472047472-30307-1-git-send-email-stli@linux.vnet.ibm.com> References: <1472047472-30307-1-git-send-email-stli@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082414-0040-0000-0000-000002180B4A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082414-0041-0000-0000-00002176A521 Message-Id: <1472047472-30307-6-git-send-email-stli@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-24_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-1604210000 definitions=main-1608240127 This patch uses the libc_ifunc macro to create already existing ifunc functions clock_getres, clock_gettime, clock_settime, clock_getcpuclockid and clock_nanosleep. If HAVE_IFUNC is defined, the macro COMPAT_REDIRECT uses the libc_ifunc macro. Furthermore some whitespace damage is cleaned. ChangeLog: * rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro. --- rt/clock-compat.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/rt/clock-compat.c b/rt/clock-compat.c index dc69e4a..b47781c 100644 --- a/rt/clock-compat.c +++ b/rt/clock-compat.c @@ -28,13 +28,9 @@ #include #if HAVE_IFUNC -# define COMPAT_REDIRECT(name, proto, arglist) \ - __typeof (name) *name##_ifunc (void) asm (#name); \ - __typeof (name) *name##_ifunc (void) \ - { \ - return &__##name; \ - } \ - asm (".type " #name ", %gnu_indirect_function"); +# undef INIT_ARCH +# define INIT_ARCH() +# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) #else # define COMPAT_REDIRECT(name, proto, arglist) \ int \ @@ -45,21 +41,21 @@ #endif COMPAT_REDIRECT (clock_getres, - (clockid_t clock_id, struct timespec *res), - (clock_id, res)) + (clockid_t clock_id, struct timespec *res), + (clock_id, res)) COMPAT_REDIRECT (clock_gettime, - (clockid_t clock_id, struct timespec *tp), - (clock_id, tp)) + (clockid_t clock_id, struct timespec *tp), + (clock_id, tp)) COMPAT_REDIRECT (clock_settime, - (clockid_t clock_id, const struct timespec *tp), - (clock_id, tp)) + (clockid_t clock_id, const struct timespec *tp), + (clock_id, tp)) COMPAT_REDIRECT (clock_getcpuclockid, - (pid_t pid, clockid_t *clock_id), - (pid, clock_id)) + (pid_t pid, clockid_t *clock_id), + (pid, clock_id)) COMPAT_REDIRECT (clock_nanosleep, - (clockid_t clock_id, int flags, - const struct timespec *req, - struct timespec *rem), - (clock_id, flags, req, rem)) + (clockid_t clock_id, int flags, + const struct timespec *req, + struct timespec *rem), + (clock_id, flags, req, rem)) #endif