Why I can see the several same segments in the /proc/pid/maps output?
问题 Test is on the 32 bit Linux The code is as below: int foo(int a, int b) { int c = a + b; return c; } int main() { int e = 0; int d = foo(1, 2); printf("%d\n", d); scanf("%d", &e); return 0; } and when I use cat /proc/pid/maps to see the memory layout, it seems that I can see three text segment for my code and the library. ubuntu% cat /proc/2191/maps 08048000-08049000 r-xp 00000000 08:01 1467306 /home/shuai/work/asm/test1 08049000-0804a000 r--p 00000000 08:01 1467306 /home/shuai/work/asm/test1