Загрузка видео...

Не удалось загрузить видео

На главную

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 просмотров • 12 дней назад •via X (Twitter)

Комментарии: 10

Фото профиля why
why12 дней назад

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
Recandle12 дней назад

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

Фото профиля Sharapov Andrei
Sharapov Andrei10 дней назад

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
klöss12 дней назад

insightful

Фото профиля ItsekiriBro.skr
ItsekiriBro.skr12 дней назад

@tweem 110000 views

Фото профиля Ivo.usduc 💹🧲
Ivo.usduc 💹🧲12 дней назад

Never fade Tetsuo

Фото профиля GuessNope
GuessNope6 дней назад

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

Фото профиля Nidhi Singhal
Nidhi Singhal12 дней назад

@VOLDEMORT2X 😭👈🏻

Фото профиля schrodinger's catgirl
schrodinger's catgirl11 дней назад

cool

Фото профиля Lee Revell
Lee Revell11 дней назад

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

Похожие видео