번역/Stack Overflow

what does the BSS segment store?

2018. 1. 12. 22:55

Q. I know that the BSS segment stores the uninitialized global and static variables and initializes them to zero. But what if the global/static variable is initialized and my second question is I read that BSS segment doesn't consume memory, then where those it store these variables? Thanks


Q. 나는 BSS 영역이 초기화하지 않은 전역, 정적변수들을 저장하는 것과 그것들을 0으로 초기화하는 것을 알고 있습니다. 하지만, 전역/정적 변수가 초기화되면 어떡하죠? 두 번째 질문입니다. 저는 BSS 영역이 메모리를 소비하지 않는다고 읽었는데, 그러면 이 변수들은 어디에 저장되는 것인가요? 감사합니다. 




A. You probably read that the BSS segment doesn't consume space in the executable file on disk. When the executable loaded, the BSS segment certainly does consume space in memory. Space is allocated and initialised to zero by the OS loader.


A. 당신은 아마도 BSS 영역이 디스크의 실행파일 안의 공간을 소비하지 않는다는 것을 읽었을 것입니다. 실행파일이 로드되었을 때, BSS 영역은 정확히 메모리 상에서 공간을 소비합니다. 공간은 할당되고, OS Loader에 의해 0으로 초기화됩니다.