This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Fix the glibc profiling issue on arm-unknown-linux-gnueabi.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Manjunath Matti <manjunath81 at gmail dot com>
- Cc: Andreas Schwab <schwab at redhat dot com>, libc-ports at sourceware dot org, philb at gnu dot org, ryosei dot takagi at ap dot sony dot com, madhvesh dot s at ap dot sony dot com
- Date: Tue, 8 Feb 2011 20:18:21 +0000 (UTC)
- Subject: Re: [PATCH] Fix the glibc profiling issue on arm-unknown-linux-gnueabi.
- References: <AANLkTikDh1HO-k0hqT0XcNJNnMSg9aZh1OTHTDw5TD9E@mail.gmail.com> <m3oc7e8hig.fsf@redhat.com> <AANLkTinfHjWSm5pwZ2ABW+0XV=C7ww2=qg9NALfmddw8@mail.gmail.com> <m3bp3d8d47.fsf@redhat.com> <AANLkTimBwPfcRCgQsMu2P_56kVgmxrafVAeVZ5UXXTPY@mail.gmail.com> <Pine.LNX.4.64.1101251755420.29909@digraph.polyomino.org.uk> <AANLkTinmvj1ktO-9vcLxrWW5Ma5e3G+sNVN5QuYEMVRJ@mail.gmail.com> <Pine.LNX.4.64.1101281343590.19302@digraph.polyomino.org.uk> <AANLkTimQ2qgs41BAKhLK_Xpf5Ts_Kz=G=UyvY63QbMVp@mail.gmail.com>
On Mon, 31 Jan 2011, Manjunath Matti wrote:
> This time I have created the patch with the following sources
> glibc-2.12.2 and glibc-ports 2.12.2
>
> I have even tested it on ARMv7a (Beagle Board) and hope this would be
> fine to be main lined.
Thanks, this patch is a lot closer to being ready to go in.
> /* If compiled for profiling, call `mcount' at the start of each function. */
> #ifdef PROF
> +/* Call __gnu_mcount_nc if GCC > 4.4 and abi = EABI */
> +#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
> +#define CALL_MCOUNT \
> + str lr,[sp, #-4]!; \
> + cfi_adjust_cfa_offset (4); \
> + cfi_rel_offset (lr, 0); \
> + bl PLTJMP(mcount);
I think you need
cfi_adjust_cfa_offset (-4)
cfi_restore (lr)
here, since from the caller's perspective the "bl PLTJMP(mcount)"
instruction (calling __gnu_mcount_nc via the mcount macro you define
later) acts by popping lr.
--
Joseph S. Myers
joseph@codesourcery.com