Finding virtual address of functions in code
Andrew Haley
aph@redhat.com
Sun Jul 1 14:27:00 GMT 2018
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
More information about the Gcc
mailing list