Most Signifiant Static & Shared Libraries Objective Questions
Q – 1 After using the shared library, memory can be done free by calling:
a) dlclose
b) slclose
c) lclose
d) none of the mentioned?
Ans- a) dlclose
Q – 2 After using the shared library, memory can be done free by calling:
a) dlclose
b) slclose
c) lclose
d) none of the mentioned?
Ans- a) dlclose
Q – 3 In Linux, the static library has the extension of:
a) .a
b) .b
c) .c
d) .d
Ans- a) .a
Q – 4 Which option of GCC compiler provides the linking with shared libraries?
a) -lmylib
b) -lib
c) -mylib
d) none of the mentioned
Ans- a) -lmylib
Q – 5 Shared libraries are linked with the program:
a) at the time of creation of executable
b) at the run time
c) both (a) and (b)
d) none of the mentioned
Ans- b) at the run time
Q – 6 Which command can be used to update the shared library system?
a) lconfig
b) ldconfig
c) slconfig
d) none of the mentioned
Ans- b) ldconfig
Q – 7 For a shared library, version number is changed when:
a) changes done in code make the shared library incompatible with the previous version
b) changes done in code does not make the shared library incompatible with the previous version
c) when minor number is changed
d) none of the mentioned
Ans- a) changes done in code make the shared library incompatible with the previous version
Q – 8 When a program is linked with a shared library:
a) only a small table is created in the executable
b) executable contains the whole content of respective .so file
c) executable contains nothing related with the shared libraries
d) none of the mentioned
Ans- a) only a small table is created in the executable
Q – 9 In GCC compiler, “-shared” option is given to create the shared library with:
a) source files
b) object files
c) executables
d) none of the mentioned
Ans- b) object files
Q – 10 In linux, shared library is a:
a) text file
b) binary file
c) device file
d) none of the mentioned
Ans- b) binary file
Q – 11 Shared libraries can be shared between:
a) various running programs
b) only 2 running programs
c) only 8 running programs
d) none of the mentioned
Ans- a) various running programs
Q – 12 In linux shared libraries has the extension of:
a) .so
b) .si
c) .sl
d) none of the mentioned
Ans- a) .so
Q – 13 The library contains the:
a) pre-compiled object files
b) source files
c) header files
d) none of the mentioned
Ans- a) pre-compiled object files
Q – 14 In Linux, the static libraries can be created by:
a) ar command
b) as command
c) ap command
d) aq command
Ans- a) ar command
Q – 15 Libraries can be linked with ____ to create executables.
a) other libraries
b) other object files
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 16 If a program is linked against a static library then:
a) machine code of the used function is copied in the executable
b) used function definition is copied into the preprocessd code
c) used function definition is provided at the time of compiling
d) none of the mentioned
Ans- a) machine code of the used function is copied in the executable
Q – 17 To use the static library in the program:
a) header file must be provided to in the source code
b) path for the library must be specified
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 18 The archive(ar) utility in linux can:
a) create a new static library
b) insert the object files into the static library
c) replace the object files into the static library
d) all of the mentioned
Ans- d) all of the mentioned
Q – 19 In linux, the static libraries are mostly installed in:
a) /usr/lib
b) /usr/local/lib
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 20 Which one of the following command can list the symbols defined in a library?
a) mn
b) nm
c) nn
d) mm
Ans- b) nm