Re: _start and main labels in C programs

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

 



On 12/25/2010 12:48 PM, ali hagigat wrote:
When i compile a C program two labels are seen at the final object
code main and _start.
Which one is executed first?

In default compilation/linking mode, this is _start.

You could also easily verify this by using nm(1) and readelf(1):

andi@randazzo:/development/sandbox$ readelf -h test.exe
[...]
  Entry point address:               0x80482e0
[...]

andi@randazzo:/development/sandbox$ nm test.exe | grep _start
[...]
080482e0 T _start
[...]


Andi


[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