This is the mail archive of the gcc@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: _GLOBAL_ query


Hi there,

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.

> Thanks,
> Inder

HTH, cheers.

l8er
manfred


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