Moksh
Moksh

Reputation: 31

What is the difference in using global _main and global _start in the text section of asm

I am new at assembly language. I have been studying it but i am confused between these two: global _main and global _start.. If anyone knows it, please help!

Upvotes: 2

Views: 2572

Answers (1)

Frank Kotler
Frank Kotler

Reputation: 3119

main or _main or main_ (OpenWatcom) is known to the C language, and is called by "startup code" which is "usually" linked to - if you're using C.

_start is known to the linker ld (in Linux) as the default entrypoint (another symbol can be used) and is not called. Thus, there is no return address on the stack. Stack starts with number of arguments. Your OS may differ.

Upvotes: 4

Related Questions