Embedded Systems Questions and Answers – The Compilation Process-II

This set of Embedded Systems Multiple Choice Questions & Answers focuses on “The Compilation Process-II”.

1. Which of the following are header files?
a) #include
b) file
c) struct()
d) proc()
View Answer

Answer: a
Explanation: The #include is a header file which defines the standard constants, variable types, and many other functions. This can also include some standard libraries.

2. Which is the standard C compiler used for the UNIX systems?
a) simulator
b) compiler
c) cc
d) sc
View Answer

Answer: c
Explanation: The cc is the standard C compiler used in the UNIX system. Its command lines can be pre-processed, compiled, assembled and linked to create an executable file.

3. Which compiling option is used to compile programs to form part of a library?
a) -c
b) -p
c) -f
d) -g
View Answer

Answer: a
Explanation: There are several options for the compilers. The option -c compiles the linking stage and then leaves the object file. This option is used to compile programs to form a part of the library.
advertisement
advertisement

4. Which compiling option can be used for finding which part of the program is consuming most of the processing time?
a) -f
b) -g
c) -p
d) -c
View Answer

Answer: c
Explanation: The -p instructs the compiler to produce codes which count the number of times each routine is called and this is useful for finding the processing time of the programs.

5. Which compiling option can generate symbolic debug information for debuggers?
a) -c
b) -p
c) -f
d) -g
View Answer

Answer: d
Explanation: The -g generates the symbolic debug information for the debuggers. Without this, the debugger cannot print the variable values, it can only work at the assembler level. The symbolic information is passed through the compilation process and stored in the executable file.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following is also known as loader?
a) locater
b) linker
c) assembler
d) compiler
View Answer

Answer: b
Explanation: The linker is also known as a loader. It can take the object file and searches the library files to find the routine it calls.

7. Which of the following gives the final control to the programmer?
a) linker
b) compiler
c) locater
d) simulator
View Answer

Answer: a
Explanation: The linker can give the final control to the programmer concerning how unresolved references are reconciled, where the sections are located in the memory, which routines are used, and so on.
advertisement

8. Which command takes the object file and searches library files to find the routine calls?
a) simulator
b) emulator
c) debugger
d) linker
View Answer

Answer: d
Explanation: The linker is also known as a loader. It can take the object file and searches the library files to find the routine it calls. The linker can give the final control to the programmer concerning how unresolved references are reconciled, where the sections are located in the memory, which routines are used, and so on.

9. Which assembler option is used to turn off long or short address optimization?
a) -n
b) -V
c) -m
d) -o
View Answer

Answer: a
Explanation: The option -o puts the assembler into the file obj file, -V can write the assembler’s version number on the standard error output, -m runs the macro preprocessor on the source file and -n turns off the long or short address optimization.
advertisement

10. Which assembler option runs the m4 macro preprocessor on the source file?
a) -n
b) -m
c) -V
d) -o
View Answer

Answer: b
Explanation: The option -o puts the assembler into the file obj file, -V can write the assembler’s version number on the standard error output, -m runs the macro preprocessor on the source file and -n turns off the long or short address optimization.

Sanfoundry Global Education & Learning Series – Embedded System.

To practice all areas of Embedded Systems, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.