I “objdump -d” an executable, e.g, /bin/ls, and I found there’s not any main function in the assembly code. Why?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several possible explanations:
maindoesn’t mean the world requires one.mainfunction may have been inlined or eliminated by the compiler in general. The operating system just calls an entry point; it doesn’t care if that’s actually the start of a function calledmain.objdump)Objdumpmight not expose all possible symbols in a program; given that you’re pointing it at linked executable and not object files, there’s not really a contract for objdump to tell you every possible function in the executable; just those which might be called externally.Symbolic information are only mnemonics; the processor isn’t looking at these things at all.