What is c/c++ data segment and stack size?
问题 I read that it depends on the compiler and operating system architecture. How do I find out the data segment and stack max size on a Linux system using GCC as compiler? 回答1: Let me experiment with you: create file ``test.c'' like this: int main (void) { return 0; } Now compile it, specifying max stack size (just to easy lookup this number in map file and determine symbol name, refering to it): gcc test.c -o test.x -Wl,--stack=0x20000 -Wl,-Map=output.map Determining data size is simple: size