This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Treatment of builtin that receives function pointer
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 28 Jan 2010 14:58:48 +0000
- Subject: Re: Treatment of builtin that receives function pointer
- References: <11b141711001270425j3f40d3a4p543806809ab41667@mail.gmail.com> <11b141711001280644j7e42ee6fib43a0c276f425e8@mail.gmail.com>
On 01/28/2010 02:44 PM, Paulo J. Matos wrote:
> On Wed, Jan 27, 2010 at 12:25 PM, Paulo J. Matos <pocmatos@gmail.com> wrote:
>> Now, I wonder in this more general case, where can I obtain the
>> function decl (so I can get its assembler name) for the function the
>> pointer is pointing to?
>>
>
> Allow me to revive this question by asking if I can obtain the
> function assembler name given a direct function pointer to the
> function.
>
> For example:
> void foo1(void) {...}
>
> __get_name(foo1) ==> "foo1"
>
> int foo2(int *x) { ... }
>
> __get_name(foo2) ==> "foo2"
>
> This is all I need. Any tips?
dladdr()
Andrew.