Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

For dynamically linked GCC/glibc programs on Linux, main() is not the process entry point. The kernel starts the loader. It maps libc and applies relocations. _start passes main to glibc, which initializes the process and calls it. I traced the path from source.c to main().

17,090 görüntüleme • 2 ay önce •via X (Twitter)

10 Yorum

why profil fotoğrafı
why2 ay önce

The jump from the kernel entry point to _start, then through libc before main(), is one of those details that makes the runtime feel much less magical.

Recandle profil fotoğrafı
Recandle2 ay önce

Most people think a C program starts at main(). It doesn’t. The kernel starts the loader first.

Sharapov Andrei profil fotoğrafı
Sharapov Andrei2 ay önce

Almost. The kernel does not start _start. It maps the ELF, reads PT_INTERP, jumps into Relocations finish there. Only then does control reach _start, which passes &main into _libc_start_main. main is a callback. If your mental model starts at main, you already skipped the ABI.

klöss profil fotoğrafı
klöss2 ay önce

insightful

ItsekiriBro.skr profil fotoğrafı
ItsekiriBro.skr2 ay önce

@tweem 110000 views

Ivo.usduc 💹🧲 profil fotoğrafı
Ivo.usduc 💹🧲2 ay önce

Never fade Tetsuo

GuessNope profil fotoğrafı
GuessNope1 ay önce

It's not the entry point for statically linked ones either. It's just the start of the C platform.

Nidhi Singhal profil fotoğrafı
Nidhi Singhal2 ay önce

@VOLDEMORT2X 😭👈🏻

schrodinger's catgirl profil fotoğrafı
schrodinger's catgirl2 ay önce

cool

Lee Revell profil fotoğrafı
Lee Revell2 ay önce

I tied for the biggest bug bounty at my last employer with an LD_PRELOAD exploit. Any support tech could have gotten root

Benzer Videolar