Re: GCC not calling __main()?

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

 



On Wed, Sep 12, 2007 at 04:27:19PM -0700, Rick Mann wrote:
> 
> So, I currently build with -nostartfiles. I tried removing that, and  
> I got a complaint about _start being defined twice (as I expected).  
> So, I removed my own start.o, and it links fine. When I look at the  
> resulting output, I see a bunch of code that looks like the right  
> _init() stuff. However, I can no longer find _start (perhaps it's  
> aliased somehow and objdump is using the alias?).

   You'll just have to add code to your start.S to call atexit(_fini) and
call _init(). See the existing crt0.S. Also check with -v that you're
linking in the right order. You should have start.o crti.o crtbegin.o
<everything else here> crtend.o crtn.o.
 
-- 
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