Run-Time-Environment

Question 1

A linker is given object modules for a set of programs that were compiled separately. What information need to be included in an object module?

A
Object code
B
Relocation bits
C
Names and locations of all external symbols defined in the object module
D
Absolute addresses of internal symbols
Question 1 Explanation: 
In object module it includes names and locations of all external symbols defined in the object module.
To link to external symbols it must know the location of external symbols.
Question 2

Consider the following statements.

    I. Symbol table is accessed only during lexical analysis and syntax analysis.
    II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment.
    III. Errors violating the condition ‘any variable must be declared before its use’ are detected during syntax analysis.

Which of the above statements is/are TRUE?

A
II only
B
I only
C
I and III only
D
None of I, II and III
Question 2 Explanation: 
I is wrong as Symbol table is also accessed during semantic analysis phase.
II is wrong as compilers which supports recursion require stack memory in run time environment.
III is wrong “any variable must be declared before its use” is a semantic error and not syntax error.
Question 3

A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which of the following is true?

A
A compiler using static memory allocation can be written for L
B
A compiler cannot be written for L; an interpreter must be used
C
A compiler using dynamic memory allocation can be written for L
D
None of the above
Question 3 Explanation: 
Compiler is use dynamic memory allocation then the memory will be allocated to an array at runtime.
Question 4

Heap allocation is required for languages

A
that support recursion
B
that support dynamic data structures
C
that use dynamic scope rules
D
None of the above
Question 4 Explanation: 
Heap allocation is required for languages that support dynamic data structures.
There are 4 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access