public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Finding virtual address of functions in code
       [not found] <20180701141956.AF00FDA2E1@zmta04.collab.prod.int.phx2.redhat.com>
@ 2018-07-01 14:27 ` Andrew Haley
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Haley @ 2018-07-01 14:27 UTC (permalink / raw)
  To: Mahmood Naderan, gcc

On 07/01/2018 03:19 PM, Mahmood Naderan via gcc wrote:

> Is there any builtin function in C which prints the virtual address
> of functions including the main? I see __builtin_return_address()
> but that returns the “return address”.

#include <stdio.h>
int main() {
  printf("%p\n", main);
}

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Finding virtual address of functions in code
       [not found] <20180701141942.5A8DE55FDC0@zimbra11-e2.priv.proxad.net>
@ 2018-07-01 14:27 ` Eric Botcazou
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Botcazou @ 2018-07-01 14:27 UTC (permalink / raw)
  To: Mahmood Naderan; +Cc: gcc

> Is there any builtin function in C which prints the virtual address of
> functions including the main? I see __builtin_return_address() but that
> returns the “return address”.

This list is not appropriate for such a question, use gcc-help@ instead.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Finding virtual address of functions in code
@ 2018-07-01 14:19 Mahmood Naderan via gcc
  0 siblings, 0 replies; 3+ messages in thread
From: Mahmood Naderan via gcc @ 2018-07-01 14:19 UTC (permalink / raw)
  To: gcc

Hi,
Is there any builtin function in C which prints the virtual address of functions including the main? I see __builtin_return_address() but that returns the “return address”.

Regards,
Mahmood

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-01 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180701141956.AF00FDA2E1@zmta04.collab.prod.int.phx2.redhat.com>
2018-07-01 14:27 ` Finding virtual address of functions in code Andrew Haley
     [not found] <20180701141942.5A8DE55FDC0@zimbra11-e2.priv.proxad.net>
2018-07-01 14:27 ` Eric Botcazou
2018-07-01 14:19 Mahmood Naderan via gcc

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