My question is based on this tiny stkaddr.cpp program:
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("&argc = %p\n", &argc);
}
Using Visual Studio 2019, I know that I can use linker option /DYNAMICBASE:NO to have invariant(constant) local variable address across each run. May be we call it "no ASLR".
With /DYNAMICBASE:NO, each run of the exe we see the same address for &argc.
Then I'd like to ask how can I achieve this for a gcc compiled Linux program.
On Ubuntu Linux 20.04, with gcc 9.4.0, I tried -no-pie, but no effect.

