79162106

Date: 2024-11-06 10:07:35
Score: 2
Natty:
Report link

With -fcommon (default in GCC up to version 10), uninitialized globals var2 are placed in the COMMON section, allowing multiple definitions across files.

enter image description here

With -fno-common (default in GCC 10 and later), uninitialized globals var2 are no longer placed in the COMMON section. Instead, it is given a specific section index, treated as strong symbols, that may resulting in linker errors if the same variable name appears uninitialized in multiple files.

enter image description here

Reasons:
  • Probably link only (1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Shelton Liu