Where does a program start?

I would like to know how a computer handles a program. If hypotheses must be made, assume we’re talking about Linux/x86.

If I look at the program with objdump -D, I can see a lot of sections such as .init, .start, __gmon_start__@plt etc.

But where does it start? I would like to say .init, but if I start the program here, using gdb and a breakpoint, I’m not convinced as the registers already have some values that do not seem random.

In fact, I would like to follow step by step the behaviour of a very little program, but I don’t know where to put my breakpoint.

Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.