One of the reasons the object files generated by the assembler is not executable is that each object file is created independent of other object files in the program. Hence, they are not aware of the other object files in the program; therefore, linking of object files in needed to generate an executable file. If a project has only one source file (hence one object file) and is it is not using any library files, can this object file be executed? Why or why not
Answer will be "Yes"
Because an object file contains the object code that is machine that is output assembler or compiler.Basically the object code is usually relocatable and and not usually directly executable.
An object may also work like a shared liberary.
In addition to the object code itself, object files may contain metadata used for linking or debugging, including: information to resolve symbolic cross-references between different modules, relocation information, stack unwinding information, comments, program symbols, debugging or profiling information.
So, as we come to know that an object may also work like a shared liberary, So the object file will be executable.
Get Answers For Free
Most questions answered within 1 hours.