#include <stdio.h> #include <string.h> int main(){ FILE *fp; fp = fopen("/proc/self/maps", "re"); if (fp != NULL) { char buf[256]; while (fgets(buf, sizeof(buf), fp) != NULL) { if (strstr(buf, "[stack]") != NULL) { puts(buf); } } fclose(fp); } return 0; } [rarul@tina ~]$ gcc -c -o main.o main.c [rarul@tina ~]$ gcc -c -o asm.o asm.S [rarul@tina ~]$ gcc -o stack_exec main.o asm.o [rarul@tina ~]$ ./s