I am trying to understand the operation of the linker and the loader, as well as the memory addresses (physical or virtual) as to how the program actually compiles and runs. I came across two pieces of information and created my own version of understanding.
1st information:
W.5.1 GENERAL OBJECTS In a typical system, a number of programs will run. Each program relies on a number of functions, some of which will be standard C library functions, such as printf (), malloc (), strcpy (), etc., and some non-standard or user-defined functions. If each program uses the standard C library, this means that each program typically has a unique copy of that particular library inside. Unfortunately, this result in spent resources degrades efficiency and productivity. ** Since the C library is common, it is better for each program to reference a common, one copy of this library, instead of each program containing a copy of the library. This is done during the linking process, when some of the objects are linked during the linking,while some of them are executed at runtime (deferred / dynamic binding). **
The second information:
C library
Main articles: see the C library, creating the C library One thing to come: When you start working with the kernel, you do not have the C library available. You must provide everything yourself, with the exception of a few parts provided by the compiler itself. You will also need to have an existing C library or write it yourself. The C library implements standard C functions (i.e., things stated in, etc.) and provides them in binary form for communication with user space applications. In addition to the C function standard (as defined in the ISO standard), the C library can (and usually does) implements additional functions that may or may not be defined by any standard. The C standard library says nothing about the network, for example. For Unix-like POSIX systems, the standard defines what is expected from the C library;other systems may differ fundamentally. It should be noted that in order to implement its functionality, the C library must call the kernel functions. So, for your own OS, you can, of course, take ready-made C libraries and just recompile it for your OS, but it requires you to tell the libraries how to call the kernel functions, and your kernel actually provides these functions. A more sophisticated example is available in Library Calls or, you can use your existing C library or create your own C Library.how to call kernel functions, and your kernel actually provides these functions. A more sophisticated example is available in Library Calls or, you can use your existing C library or create your own C Library.how to call kernel functions, and your kernel actually provides these functions. A more sophisticated example is available in Library Calls or, you can use your existing C library or create your own C Library.
:
, C, . . , Linux. , linux.
linux, , C ( , printf ) ( , ). , , printf() C. , printf(), , printf() .
, , , ( , ). printf(), , printf().
? , ?