Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Somehow the compiler needs to either have the whole program in one single go--every last source file at the same time, all with exactly the same build options--or there needs to be a way to combine the results of multiple compilation steps.

Even with modern LTO, the compiler doesn't typically see _all_ files in the program at the source code level. Just many. Usually the C-library and C++ library are different.

So as long as various languages don't build the entire program in a single compilation and assembly step, we will need something that combines the results.

That's the linker.

Even building everything statically doesn't eliminate the need for the runtime linker, unless one hard-codes the exact address where a program can run. That runs counter to security measures like ASLR.



> Even building everything statically doesn't eliminate the need for the runtime linker, unless one hard-codes the exact address where a program can run. That runs counter to security measures like ASLR.

You could have the program be position independent (use only relative adressing) and do without a linker for that limited use case.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: