News for hackers. Stuff that matters.
Re:Linux x86 program start up – How the heck do we get to ma... by ebingdom on Thursday November 04, 2021 @08:29AM (#29106302)
> It can't be returned from, the exit system call must be issued before execution terminates.

So what happens if exit isn't called?

Re:Linux x86 program start up – How the heck do we get to ma... by JCWasmx86 on Thursday November 04, 2021 @08:33AM (#29106325)
1. If you add a "ret", you just jump to an invalid address.

2. If you add nothing, the CPU will continue to execute the bytes that follow.

In both cases it is quite certain you end with a segmentation fault.(Or in case 2., an illegal instruction)

Re:Linux x86 program start up – How the heck do we get to ma... by chrisseaton on Thursday November 04, 2021 @09:22AM (#29106837)
You keep running whatever ‘instructions’ appear in the data after your last program instruction, so you could most likely have a segmentation fault, or worse run some random data as instructions and so crash, or worse still run some random data that happens to also be real instructions that does something harmful.
Re:Linux x86 program start up – How the heck do we get to ma... by matheusmoreira on Thursday November 04, 2021 @08:38AM (#29106368)
Segmentation violation.

I've seen code with a hlt instruction after main and the exit system call. Not sure what their intentions are, it should be unreachable.