----- Original Message ----- > From: chru...@suse.cz > To: "Jan Stancek" <jstan...@redhat.com> > Cc: ltp-list@lists.sourceforge.net > Sent: Tuesday, 26 August, 2014 10:55:19 AM > Subject: Re: [LTP] [PATCH/RFC] profil01: don't use address of function > > Hi! > > I think it was introduced in 90s, though not every architecture supported > > it at first. > > > > I see it in very first release of clang 1.0 sources: > > ./src/gcc/builtins.def:DEF_GCC_BUILTIN > > (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UNSIGNED, > > ATTR_NULL) > > but I didn't try to compile it with that. > > > > > > > > If we are in doubt, we should add a configure check and use it only when > > > available. And probably to default to &test_profil in all cases but > > > ppc64 BE which is known to fail. > > > > I'm trying one other idea: > > > > +static inline void *get_pc(void) > > +{ > > + extern void *profil01_label; > > + > > + asm("profil01_label:"); > > + return &profil01_label; > > +} > > It looks like I've accidentally deleted your reply to this email, sorry. > > As both methods (the one with builtin and the one with asm()) seems to > work fine, feel free to proceed with either one of them.
Pushed. (I went with the gcc builtin) Regards, Jan > > -- > Cyril Hrubis > chru...@suse.cz > ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list