Linker: Combining Object Files to Executables - Essay Sample

Paper Type:  Essay
Pages:  3
Wordcount:  603 Words
Date:  2023-06-10

Introduction

A linker is a program that performs the task of collecting multiple objects files and combines them into a single file. To create an executable file, one has to combine object files. A linker is also known as a link editor. A linker is useful in the c programming language. The process in linking involves resolving the symbolic address to numerical addresses. The C files have program codes that help in running the program. The c file has a .c file extension. Essential parts in the C file are (#Include) this part of the code allows basic input and output, (int main) this declares the primary function, ({ )this shows the start, (} )while this indicates the end,(printf) this shows the output on the screen and return 0. The C file has definitions that help in reserving space for variables and declarations which tell the compiler what to output.

Trust banner

Is your time best spent reading someone else’s essay? Get a 100% original essay FROM A CERTIFIED WRITER!

Variables in C programming include global, which is useful globally in the program, and local variables, which is helpful in a single function. The C compiler converts the source code, which is the program code to machine language called the object file. The C compiler dissects object files using a key tool command, which gives information about the symbols in the object file. The object files which previously got executed are linked together with other object files. Duplicate symbols are errors. The linker takes the first object file from the static library, provided the symbol has no definition yet. The linker gives an error if it cannot find a meaning for the symbol to join reference to that symbol. The operating system has to transfer machine code from the executable file on the hard disk into the computer's memory where the CPU can get it and execute the program.

Static libraries are a collection of ordinary object files. They allow users to link to programs without having to recompile the code, thus saving recompilation time. The disadvantage of static libraries is that they take longer to execute. Shared libraries are loaded by programs when they start. They are faster because the library gets linked dynamically; thus, the code is loaded anywhere in the memory. The shared library is the open file opened by a process and can get used by many programs. Windows dynamic link library gets used for holding multiple codes and ways for windows programs. They help use resources such as memory more efficiently and can be used by various programs at the same time.

C++ provides features that interact with the operation of the linker. C ++ allows function overloading where one code can have many functions with the same name but different signatures. Function overloading is possible in C programming with the help of pointers and the linker. Name mangling is a technique of adding more information to function names to differentiate functions in function overloading. Object constructors are codes that set up the contents of an object and are equal to an initialized value. Templates are useful as they allow code to get written once. Dynamically loaded libraries get loaded at times other than during the start of the program. They help implement plugins or modules. Dynamically loaded libraries facilitate interaction with C++ features.

Linkers are useful in creating interaction with C++ features and creating multiple codes. The disadvantage of linkers is they take longer to execute. Linkers are very useful in C programming. The ability to interact with other programming languages helps in the development of system application software.

References

Barron, David.W. Linkers and loaders (2003): 988-991.

Presser, leon and John R.White. "ACM Computing Surveys." linkers and loaders (1972): 149-167.

Cite this page

Linker: Combining Object Files to Executables - Essay Sample. (2023, Jun 10). Retrieved from https://proessays.net/essays/linker-combining-object-files-to-executables-essay-sample

logo_disclaimer
Free essays can be submitted by anyone,

so we do not vouch for their quality

Want a quality guarantee?
Order from one of our vetted writers instead

If you are the original author of this essay and no longer wish to have it published on the ProEssays website, please click below to request its removal:

didn't find image

Liked this essay sample but need an original one?

Hire a professional with VAST experience and 25% off!

24/7 online support

NO plagiarism