Re: GCC not calling __main()?

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

 



On Wed, Sep 12, 2007 at 11:06:12AM -0700, Rick Mann wrote:
> 
> On Sep 12, 2007, at 1:57 AM, Rask Ingemann Lambertsen wrote:
> 
> >If your target defines the INIT_SECTION_ASM_OP macro, then __main()  
> >isn't normally used.
> 
> Thanks for that info. If I understand it correctly, the various  
> macros need to be defined when building GCC, right (not when building  
> target code).

   Yes. Most ELF targets don't use __main() while e.g. all a.out targets
must (I think).

> How do I determine how my target was built? I chose --target=arm-elf,  
> and searching in the GCC sources for macro names like  
> TARGET_ASM_NAMED_SECTION and INIT_SECTION_ASM_OP turn up nothing in  
> gcc/config/arm/elf.h. Where else should I be looking?

   For ELF targets, usually gcc/config/elfos.h (which many targets include
indirectly through gcc/tm.h which lives in the build directory and is set up
in gcc/config.gcc - look for arm*-*-elf and the tm_file definition).

> If I need to change the configuration, how do I do that? On the  
> configure line? Or do I pre-define some things when calling make?

   Adding

#undef INIT_SECTION_ASM_OP

to gcc/config/arm/elf.h ought to do the trick.

-- 
Rask Ingemann Lambertsen

[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