Re: Meaning of -fcommon and -fno-common

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Amittai Aviram <amittai.aviram@xxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux