Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Definition of impure Executable

Tags:

linux

linker

First, I'd like to apologize for possible bad English. I'm Dutch..

My Question : In the Linux man-pages and kernel-code the term "impure executable" comes up many times, but no definition can be found. Is there anybody here that can explain wat is meant by an "impure executable?". I figure it has something to do with how the linker is invoked, but I could be wrong..

Regards,

Peter

like image 474
Peter M. Groen Avatar asked Sep 05 '25 01:09

Peter M. Groen


1 Answers

As stated at point 14 here: http://linux-distributions.org/docs/faq/GCC-FAQ.txt

An "impure" executable file does not have its segments padded to page boundaries whereas a "pure" executable does.

When running a "pure" executable the kernel can simple forget code pages instead of having to write them to swap space as they can simply be demand paged back in. It also allows code pages to be shared cleanly between processes. This is not possible for "impure" executables.

Any program that will use significant amounts of memory, have multiple instances or remain resident (daemons) should be built as a "pure" executable.

like image 196
Nathan Avatar answered Sep 06 '25 16:09

Nathan