This is the mail archive of the
mailing list for the GCC project.
Re: _GLOBAL_ query
On Thu, 16 Mar 2006, 11:35:56 +0100, Inder wrote:
> Hi All
> I have a query regarding __GLOBAL_ prefixed symbols.
> while compiling the testcase given below produces
> a symbol '_GLOBAL__I_main', which according to the defination of
> static global initiallization should be a global symbol. But
> gcc makes it a local symbols.
> can anyone explain the reason for this behaviour.
GCC creates a file local function responsible for performing the
execution of any global CTORS. This function is named after the first
function in the file, in your case "main"; try inserting another dummy
function before main and check again. If you look at the other symbols
generated by GCC, you will see that it also creates a globally visible
symbol for main.