Where do I find the assembly that creates a static variable in the .data section of my C program?

后端 未结 4 578
终归单人心
终归单人心 2021-01-05 21:27

First time poster. 2nd year CS student.

I am exploring the creation of static variables in the .data section of the Virtual Address Space in the context of a C sourc

4条回答
  •  天涯浪人
    2021-01-05 21:34

    Just to add that on bare-metal hardware (ie. microcontrollers) (where you don't have the benefits of binary loaders), you will see the code that zeroes the .bbs and copies .data section from RO FLASH into RAM.

    That code will be something similar to http://repo.or.cz/w/cbaos.git/blob/HEAD:/kernel/init.c#l23 .

提交回复
热议问题