From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21186 invoked by alias); 25 Jul 2013 14:52:18 -0000 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 Received: (qmail 21175 invoked by uid 89); 25 Jul 2013 14:52:18 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 25 Jul 2013 14:52:17 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1V2Mtk-0006qo-Fd from joseph_myers@mentor.com ; Thu, 25 Jul 2013 07:52:08 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 25 Jul 2013 07:52:08 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 25 Jul 2013 15:52:04 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1V2Mte-0005F8-UX; Thu, 25 Jul 2013 14:52:03 +0000 Date: Thu, 25 Jul 2013 14:52:00 -0000 From: "Joseph S. Myers" To: Marcus Shawcroft CC: Subject: Re: [PATCH] [AArch64] Provide symbol versions for mcount and _mcount. In-Reply-To: <1374739714-5774-1-git-send-email-marcus.shawcroft@linaro.org> Message-ID: References: <1374739714-5774-1-git-send-email-marcus.shawcroft@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-07/txt/msg00035.txt.bz2 On Thu, 25 Jul 2013, Marcus Shawcroft wrote: > +/* Machine-dependent definitions for profiling support. Generic GCC 2 version. You mean "AArch64 version". > +/* GCC version 2 gives us a perfect magical function to get > + just the information we need: > + void *__builtin_return_address (unsigned int N) > + returns the return address of the frame N frames up. */ > + > +/* Be warned that GCC cannot usefully compile __builtin_return_address(N) > + for N != 0 on all machines. In this case, you may have to write > + your own version of _mcount(). */ "all machines" comment irrelevant. > +#if __GNUC__ < 2 > + #error "This file uses __builtin_return_address, a GCC 2 extension." > +#endif No need for such conditionals except in installed headers and files shared with gnulib. (Yes, there are various cases still needing cleaning up across glibc.) > +/* We forgot to add _mcount and mcount in glibc 2.17. We added them in 2.18 > + therefore we want them to be added with version GLIBC_2_18. However, setting > + then version is not straight forward because generic Version files include > + an earlier 2.xx version for each of these symbols and the linker uses the > + first version it sees. */ > + > +#if SHLIB_COMPAT (libc, GLIBC_2_17, GLIBC_2_18) > +/* The canonical name for the function is `_mcount' in both C and asm, > + but some old asm code might assume it's `mcount'. */ You shouldn't have such "old asm" for a new architecture, which would indicate that you shouldn't need the "mcount" name at all. But, given that you want that name, the patch seems correct for adding the versions desired, subject to my other comments. > +weak_alias (__mcount, __weak_mcount) > +versioned_symbol (libc, __weak_mcount, mcount, GLIBC_2_18); Two spaces after comma, should be one. -- Joseph S. Myers joseph@codesourcery.com