Meaning of -fcommon and -fno-common

Amittai Aviram amittai.aviram@yale.edu
Sun May 27 20:10:00 GMT 2012


The GCC manual explains the -fcommon and -fno-common flag with reference to traditional Unix practice:  "In C code, controls the placement of uninitialized global variables. Unix C compilers have traditionally permitted multiple definitions of such variables in different compilation units by placing the variables in a common block."  What exactly is a "common block" in this context?  Where is it in the file and--assuming it's an ELF executable to be run on a Linux system--what segment (virtual address range) would the OS use for it, as opposed to the data section?  Thanks!

Amittai

Amittai Aviram
PhD Student in Computer Science
Yale University
646 483 2639
amittai.aviram@yale.edu
http://www.amittai.com



More information about the Gcc-help mailing list