Do .bss section zero initialized variables occupy space in elf file?

后端 未结 4 2123
有刺的猬
有刺的猬 2020-12-04 08:44

If I understand correctly, the .bss section in ELF files is used to allocate space for zero-initialized variables. Our tool chain produces ELF files, hence my q

4条回答
  •  星月不相逢
    2020-12-04 09:09

    A .bss section is not stored in an executable file. Of the most common sections (.text, .data, .bss), only .text (actual code) and .data (initialized data) are present in an ELF file.

提交回复
热议问题