When executing a simple C program, is it possible to know at what physical address (or range of addresses) different parts of my C program (e.g. data,text, stack,heap etc) are mapped by the operating system e.g. Linux. Is it possible to achieve this using some compiler flags with gcc etc.
Also is it possible to define a static mapping for my program (in user or kernel space) such that every time I execute the program the physical addresses assigned to the program does not change.
Any help is this regard is more than welcome.
Thank You