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.

-- 
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

Reply via email to