control_ld_omit_bss_init.hss 1.2 KB

123456789101112131415161718192021222324
  1. [Main]
  2. Title=__ld_omit_bss_init
  3. [Top]
  4. Defining this symbol in a source file tells the linker that this file does
  5. not depend on the initialization of the BSS section to zero. The result is
  6. that all uninitialized global variables defined in that file may contain
  7. garbage at the beginning of the program. This does not guarantee that the
  8. initialization is skipped; in fact, if at least one file needs the
  9. initialization, it is easier to initialize even the variables that were
  10. declared to not need it.
  11. <BR><BR>
  12. For pointer-based object file formats (such as COFF, the format used by the
  13. <A HREF="http://www.gnu.org/">GNU</A> tools included in TIGCC), this symbol
  14. really affects all variables in the file it is defined in. For sequential
  15. formats (such as the AmigaOS format used by the
  16. <A HREF="$$INFOLINK(a68k)">A68k assembler</A>), it affects only the parts
  17. that follow the symbol. Since BSS data usually appears at the end of the
  18. object file, this restriction should not have any effect.
  19. <BR><BR>
  20. <B>Note:</B> If you define this symbol, you should use the
  21. <A HREF="$$INFOLINK(comopts)">compiler option</A>
  22. <B>'-fno-zero-initialized-in-bss'</B>; otherwise even variables explicitly
  23. initialized to zero will contain garbage.