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]

Re: Avoid __main from being called in main()?


> Date: Wed, 10 May 2000 13:44:55 +0200 (CEST)
> From: Henrik Bergstrom <henrik.bergstrom@intertex.se>

> I am trying to find out how to avoid __main from being called in
> main(). After reading 'info gcc' I thought that "-DHAS_INIT_SECTION"
> would accomplish this, but it didn't.

We use something like:

void
expand_main_function ()
{
#ifndef DONT_USE__MAIN
#if !defined (HAS_INIT_SECTION)
  emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), 0,
		         VOIDmode, 0);
#endif /* not HAS_INIT_SECTION */
#endif

and then arrange for DONT_USE__MAIN to be defined:

#define DONT_USE__MAIN

in the tm.h file.

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