This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Meaning of -fcommon and -fno-common


Amittai Aviram <amittai.aviram@yale.edu> writes:

> 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!

Common symbols exist in object files, not executables.  The linker will
group the common symbols and put them in the data segment.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]