Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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().

16,714 Aufrufe • vor 12 Tagen •via X (Twitter)

10 Kommentare

Profilbild von why
whyvor 12 Tagen

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.

Profilbild von Recandle
Recandlevor 12 Tagen

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

Profilbild von Sharapov Andrei
Sharapov Andreivor 10 Tagen

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.

Profilbild von klöss
klössvor 12 Tagen

insightful

Profilbild von ItsekiriBro.skr
ItsekiriBro.skrvor 12 Tagen

@tweem 110000 views

Profilbild von Ivo.usduc 💹🧲
Ivo.usduc 💹🧲vor 12 Tagen

Never fade Tetsuo

Profilbild von GuessNope
GuessNopevor 6 Tagen

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

Profilbild von Nidhi Singhal
Nidhi Singhalvor 12 Tagen

@VOLDEMORT2X 😭👈🏻

Profilbild von schrodinger's catgirl
schrodinger's catgirlvor 11 Tagen

cool

Profilbild von Lee Revell
Lee Revellvor 11 Tagen

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

Ähnliche Videos