R4RIN
MCQS
Unix/Lunux MCQ Quiz Hub
Linux Mcqs Questions Set 10
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. The correct sequence of GCC compilation process is
preprocessing -> compilation -> assemble -> linking
assemble -> preprocessing -> compilation -> linking
preprocessing -> assemble -> compilation -> linking
none of the mentioned
2. The preprocessor removes the _______ from the source code.
comments
header files
both comments and header files
none of the mentioned
3. The compiler converts
assembly code into machine code
preprocessed source code into assembly code
machine code into assembly code
none of the mentioned
4. The assembly code is converted into the machine code by
compiler
assembler
linker
none of the mentioned
5. What is the role of linker in the compilation process?
linker links the object code with the library code
linker converts machine code into executable machine code
linker generates an executable file
all of the mentioned
6. If sanfoundry.c is compiled with GCC, then the sanfoundry.s file will contain the
assembly code
machine code
preprocessed code
expanded source code
7. The object file contains the
assembly code
machine code
modified source code
none of the mentioned
8. If we do not specify the executable file name at the compilation time in GCC, then in linux the compiler creates executable named as
a.out
a.exe
x.out
x.exe
9. The macros specifies in source code are expanded by
preprocessor
assembler
compiler
linker
10. The preprocessor creates the file with extension
.a
.i
.s
.o
11. The a.out file is in the
ELF format
EXE format
Both EXE and ELF format
None of the mentioned
12. Which one of the following command can be used to provide executable permissions for a file?
chmod +x <filename>
chmod 777 <filename>
both chmod +x and chmod 777
none of the mentioned
13. The lines in our code that begin with the “#” character are
preprocessor directives
macros
header files
none of the mentioned
14. Command line parameters are passed by the
preprocessor
assembler
compiler
linker
15. In the preprocessing stage of compilation
header files are actually expanded and included in the source code of the program
macros are replaced by their respective values
all the comments are stripped off
all of the mentioned
16. Which compilation step makes sure that all the undefined symbols in the code are resolved.
linking
compiling
preporcessing
none of the mentioned
17. Which one of the following is not true?
we need to manually go through all intermediate stages to generate an executable in gcc
gcc compilation process always contains 4 stages
gcc compilation process always contains 3 stages
none of the mentioned
18. Preprocessed files are given the file extension _____ for c++ programs.
.i
.ii
.iii
none of the mentioned
19. The assmebly code generated depends upon the
processor archietecture
ram size
both processor archietecture and RAM size
none of the mentioned
20. The COFF stands for
common object file format
combined operation for file formats
combined object file format
none of the mentioned
21. In Linux, the static library has the extension of
.a
.b
.c
.d
22. The library contains the
pre-compiled object files
source files
header files
none of the mentioned
23. Libraries can be linked with ____ to create executables.
other libraries
other object files
both other libraries and object files
none of the mentioned
24. In Linux, the static libraries can be created by
ar command
as command
ap command
aq command
25. If a program is linked against a static library then
machine code of the used function is copied in the executable
used function definition is copied into the preprocessd code
used function definition is provided at the time of compiling
none of the mentioned
26. To use the static library in the program
header file must be provided to in the source code
path for the library must be specified
header file must be provided to in the source code & path for the library must be specified
none of the mentioned
27. Which gcc option is used to specify the library?
-c
-l
-a
-o
28. In linux, the static libraries are mostly installed in
/usr/lib
/usr/local/lib
both /usr/lib and /usr/local/lib
none of the mentioned
29. Which one of the following command can list the symbols defined in a library?
mn
nm
nn
mm
30. The archive(ar) utility in linux can
create a new static library
insert the object files into the static library
replace the object files into the static library
all of the mentioned
31. In linux shared libraries has the extension of
.so
.si
.sl
none of the mentioned
32. When a program is linked with a shared library
only a small table is created in the executable
executable contains the whole content of respective .so file
executable contains nothing related with the shared libraries
none of the mentioned
33. Shared libraries can be shared between
various running programs
only 2 running programs
only 8 running programs
none of the mentioned
34. In linux, shared library is a
text file
binary file
device file
none of the mentioned
35. In GCC compiler, “-shared” option is given to create the shared library with
source files
object files
executables
none of the mentioned
36. Which option of GCC compiler provides the linking with shared libraries?
-lmylib
-lib
-mylib
none of the mentioned
37. After using the shared library, memory can be done free by calling
dlclose
slclose
lclose
none of the mentioned
38. Shared libraries are linked with the program
at the time of creation of executable
at the run time
at the time of creation of executable & run time
none of the mentioned
39. For a shared library, version number is changed when
changes done in code make the shared library incompatible with the previous version
changes done in code does not make the shared library incompatible with the previous version
when minor number is changed
none of the mentioned
40. Which command can be used to update the shared library system?
lconfig
ldconfig
slconfig
none of the mentioned
41. For debugging with GDB, the file “sanfoundry” can be created with the command
gcc -g -o sanfoundry sanfoundry.c
gcc -g sanfoundry.c
gdb sanfoundry
none of the mentioned
42. For debugging with GDB, the compiled program can be run by the command
run
execute
/<filename>
none of the mentioned
43. In GDB, breakpoints can be set by the command
break
b
both break and b
none of the mentioned
44. GDB stands for
GNU debugger
General debugging breakpoint
General debugger
None of the mentioned
45. GDB can be used for
c language
c++ language
both c and c++ language
none of the mentioned
46. The command “gdb sanfoundy”
will start debugging for the file “sanfoundry” if the file is compiled with -g option with GCC
will create executable for debugging
will provide all errors present in the file “sanfoundry”
none of the mentioned
47. In debugging with GDB, break points can be set to
any line
any function
both any line and function
none of the mentioned
48. In GDB debugging, we can proceed to the next breakpoint with command
next
continue
both next and continue
none of the mentioned
49. At the time of debugging with GDB, if we just press ENTER
GDB will repeat the same command you just gave it
GDB will do nothing
GDB will exit
None of the mentioned
50. To print the value of a variable while debugging with GDB, ______ command can be used.
printf
print
show
none of the mentioned
Submit