What is relocation and why it is required?

What is relocation and why it is required?

Relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses. Some architectures avoid relocation entirely by deferring address assignment to run time; this is known as zero address arithmetic.

Why do we need relocation in OS?

We may need to relocate the process to a different area of memory. After loading of the program into main memory, the processor and the operating system must be able to translate logical addresses into physical addresses. Branch instructions contain the address of the next instruction to be executed.

What is program relocation explain the need for relocation with an example?

Relocation is the process of connecting symbolic references with symbolic definitions. For example, when a program calls a function, the associated call instruction must transfer control to the proper destination address at execution. Relocation entries are these data.

What is the purpose of relocation bit in object code of relocation loader?

Then the relocation bits are used to relocate the current chunk. The relocation bits may then be overwritten by the next chunk. Some computers have base-register addressing (example), that is, they implicitly add the contents of a base register B to each address: Physical address = logical address + contents of B.

How do I accept relocation?

1) I am absolutely willing to relocate: A formal answer would be: “For the right opportunity I am definitely willing to relocate. I believe that this position and company is that opportunity.” If you have no issue with relocating for this position, it would be very beneficial to ask the interviewer questions as well.

What is the concept of relocation?

: to locate again : establish or lay out in a new place. intransitive verb. : to move to a new location. Other Words from relocate Synonyms Example Sentences Learn More About relocate.

What is relocation program?

Relocation assistance refers to a business benefit where a company offers an employee help in moving to a new city or state in order to work for that company. This can include reimbursement for any moving costs, temporary lodging and travel expenses.

What is a reasonable relocation package?

A core or typical job relocation package usually covers the costs of moving and storing furnishings and other household goods, along with help selling an existing home and costs incurred house hunting, temporary housing if necessary and all travel costs by the employee and family to the new location.

Where are the pointers in the relocation table?

The relocation table is a list of pointers created by the translator (a compiler or assembler) and stored in the object or executable file. Each entry in the table, or “fixup”, is a pointer to an absolute address in the object code that must be changed when the loader relocates the program so that it will refer to the correct location.

How does the EXE loader use a relocation table?

The EXE loader uses a relocation table to find the segments which need to be adjusted. With 32-bit Windows operating systems it is not mandatory to provide relocation tables for EXE files, since they are the first image loaded into the virtual address space and thus will be loaded at their preferred base address.

When does relocation take place in a program?

Relocation is typically done by the linker at link time, but it can also be done at load time by a relocating loader, or at run time by the running program itself. Some architectures avoid relocation entirely by deferring address assignment to run time; this is known as zero address arithmetic.

How are fixups used to support relocation of a program?

Fixups are designed to support relocation of the program as a complete unit. In some cases, each fixup in the table is itself relative to a base address of zero, so the fixups themselves must be changed as the loader moves through the table.