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

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

На главную

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

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

Фото профиля why
why2 месяцев назад

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
Recandle2 месяцев назад

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

Фото профиля Sharapov Andrei
Sharapov Andrei2 месяцев назад

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öss2 месяцев назад

insightful

Фото профиля ItsekiriBro.skr
ItsekiriBro.skr2 месяцев назад

@tweem 110000 views

Фото профиля Ivo.usduc 💹🧲
Ivo.usduc 💹🧲2 месяцев назад

Never fade Tetsuo

Фото профиля GuessNope
GuessNope1 месяц назад

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

Фото профиля Nidhi Singhal
Nidhi Singhal2 месяцев назад

@VOLDEMORT2X 😭👈🏻

Фото профиля schrodinger's catgirl
schrodinger's catgirl2 месяцев назад

cool

Фото профиля Lee Revell
Lee Revell2 месяцев назад

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

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