From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Thu, 30 Jun 2011 00:46:19 +0700 Subject: link question In-Reply-To: <4E0B629E.6030302@tysdomain.com> References: <4E0B629E.6030302@tysdomain.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi... On Thu, Jun 30, 2011 at 00:36, Littlefield, Tyler wrote: > I have a quick question; this is something I haven't been able to figure > out. By using the kernel headers you can call functions that are defined > in the kernel, but you don't actually have to link to the kernel or any > sort of library. How does this work? How does compiled code call the > function if it doesn't link to it in some way or another?. you need to look closer....for example include/linux/mm.h. There you will see definition of constants and functions used for memory management. So, what library here means IMHO are group of headers that contains the needed functions/definitions by themselves. Linking? I think it's better named as "including"...indeed there are linking process during kernel build, but that is just a way to build final image using several objects which originated from the practice of refactoring etc. kindly CMIIW people... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com