100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
important questions from system programming and compiler construction $3.99   Add to cart

Exam (elaborations)

important questions from system programming and compiler construction

 6 views  0 purchase
  • Course
  • Institution

important questions from system programming and compiler construction

Preview 3 out of 22  pages

  • June 2, 2022
  • 22
  • 2021/2022
  • Exam (elaborations)
  • Questions & answers
avatar-seller
1. What is loader? Explain different functions of loader?
Ans:
Loader
• A loader is a system program, which takes the object code of a program as input and
prepares it for execution.
• Programmers usually define the Program to be loaded at some predefined location in the
memory.
• But this loading address given by the programmer is not be coordinated with the OS.
• The loader does the job of coordinating with the OS to get initial loading address for
the .EXE file and load it into the memory.
Diagram




Loader Function: The loader performs the following functions:
1) Allocation
2) Linking
3) Relocation
4) Loading
Allocation:
• Allocates the space in the memory where the object program would be loaded for
Execution.
• It allocates the space for program in the memory, by calculating the size of the program.
This activity is called allocation.
• In absolute loader allocation is done by the programmer and hence it is the duty of the
programmer to ensure that the programs do not get overlap.
• In reloadable loader allocation is done by the loader hence the assembler must supply the
loader the size of the program.

,Linking:
• It links two or more object codes and provides the information needed to allow references
between them.
• It resolves the symbolic references (code/data) between the object modules by assigning all
the user subroutine and library subroutine addresses. This activity is called linking.
• In absolute loader linking is done by the programmer as the programmer is aware about the
runtime address of the symbols.
• In relocatable loader, linking is done by the loader and hence the assembler must supply to
the loader, the locations at which the loading is to be done.
Relocation:
• It modifies the object program by changing the certain instructions so that it can be loaded
at different address from location originally specified.
• There are some address dependent locations in the program, such address must be adjusted
according to allocated space, such activity done by loader is called relocation.
• In absolute Loader relocation is done by the assembler as the assembler is aware of the
starting address of the program.
• In relocatable loader, relocation is done by the loader and hence assembler must supply to
the loader the location at which relocation is to be done.
Loading:
• It brings the object program into the memory for execution.
• Finally it places all the machine instructions and data of corresponding programs and
subroutines into the memory. Thus program now becomes ready for execution, this activity is
called loading.
• In both the loaders (absolute, relocatable) Loading is done by the loader and hence the
assembler must supply to the loader the object program.

, 2. Explain the working of a direct linking loader with a proper
example. Clearly show the entries in the different databases built by
the direct linking loader.
Ans:
• Loader is the system program which is responsible for preparing the object program for
execution and initiate the execution.

• The loader does the job of coordinating with the OS to get initial loading address for
the .EXE file and load it into the memory.

Dynamic Linking Loader:

• Dynamic Linking Loader is a general re-locatable loader

• Allowing the programmer multiple procedure segments and multiple data segments and
giving programmer complete freedom in referencing data or instruction contained in other
segments.

• The assembler must give the loader the following information with each procedure or data
segment.

• Dynamic linking defers much of the linking process until a program starts running. It
provides a variety of benefits that are hard to get otherwise.

• Dynamically linked shared libraries are easier to create than static linked shared libraries.

• Dynamically linked shared libraries are easier to update than static linked shared libraries.

• The semantics of dynamically linked shared libraries can be much closer to those of
unshared libraries.

• Dynamic linking permits a program to load and unload routines at runtime, a facility that
can otherwise be very difficult to provide.




Format of Databases:

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller 24vaibhavwaghre. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $3.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83750 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$3.99
  • (0)
  Add to cart