From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Marcus Shawcroft <marcus.shawcroft@linaro.org>
Cc: <libc-ports@sourceware.org>
Subject: Re: [PATCH] [AArch64] Provide symbol versions for mcount and _mcount.
Date: Thu, 25 Jul 2013 14:52:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.1307251448490.18813@digraph.polyomino.org.uk> (raw)
In-Reply-To: <1374739714-5774-1-git-send-email-marcus.shawcroft@linaro.org>
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
next prev parent reply other threads:[~2013-07-25 14:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 8:09 Marcus Shawcroft
2013-07-25 14:52 ` Joseph S. Myers [this message]
2013-07-26 7:35 ` Marcus Shawcroft
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.1307251448490.18813@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=libc-ports@sourceware.org \
--cc=marcus.shawcroft@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).