about BSS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • psr243
    New Member
    • Feb 2008
    • 1

    about BSS

    hi this srinivas,Hyd

    i want to know what data really having diffent section (CODE,DATA,STAC K,HEAP) after compile the code...

    and especially wht is there in BSS and DATA.. (with regarding Turbo C and Gcc)..
    and one more thing is How to reduce the code( .o i.e .exe file) size after the complitaion..

    ok bye
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    ---->
    CODE: code segment will contain machine language code.
    DATA: Global variables
    STACK:Local variables
    HEAP:Used for dynamic aloocation.

    ---->
    BSS:this is Block Started By Symbol: Static variables goes here

    --->
    I don't know about windows, But when compiling with gcc
    you can avoid flags -g,-ggdb
    also add flags like -O1,-O2,-O3 etc this decides optimization level.
    Remember that, more optimized code is more difficult to debug

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Originally posted by ashitpro
      BSS:this is Block Started By Symbol: Static variables goes here
      This is not true; the DATA segment contains all global variables, whether static
      or not, that are explicitly initialized. The BSS segment contains all globals that
      aren't explicitly initialized; they're all zero so the segment can be constructed
      instead of loaded from the COFF or ELF file.

      kind regards,

      Jos

      Comment

      Working...