Ask Question
29 July, 09:46

Explain the difference between an object file and an executable file.

+3
Answers (2)
  1. 29 July, 09:58
    0
    Object file:

    Object file has the object code. The source code, which is a program written by the programmer is compiled, is converted to an intermediate code which is called an object code. So object file is a file produced by the compiler or interpreter. The compiler eliminates the errors such as syntax errors from the source code and then converts this code to an object file which lies in the middle of source code and executable file because the CPU cannot execute an object file directly. Object file has an extension of. o in Linux and. obj in Windows and it object file is also called relocatable file and it contains data, code and information such as debugging information. This file is put into a special format to send to the linker in order to create an executable file.

    Executable file

    The object code that is produced by the compiler is then sent to the linker to generate the executable file. This is also called the final file that is executed and used to give the output of the program instructions. It has an extension of. exe Executable file is machine understandable. It is created by linking the the object files by the linker. The object files are linked using a linker which integrates the object files to produce an executable file. It is an executable file which is loaded into the memory when the program is to be run and the executable code is executed by the CPU directly.
  2. 29 July, 11:44
    0
    Explanation: A file could refer to any of the following; 1. A Linux command (working on a Linux OS) 2. An object on a computer that stores data, information, settings, or commands used with a computer program (i. e machine language).

    In these case, we're referring to the file used in machine language. The major difference between an object file and executable file is;

    An object file contains machine language directions, yet it doesn't contain code for any library schedules that might be essential.

    An executable file is a program, prepared to run. It contains the machine language codes interpreted from the programmer's source record, just as the code for any essential library schedules.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Explain the difference between an object file and an executable file. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers