Thursday, 31 May 2012

Relocation algorithm


Prg_linked_origin=<link origin> from linker cmd.
For each object module
1.T_origin = translated origin of the object module. OM_size= size of object of the object module.
2.Relocation_factor=prg_linked_origin - t_origin.
3.Read the machine language program in work_area.
4.Read RELOCTAB  of the object module.
5.For each entry in RELOCTAB
a.Trans_addr = address in RELOCTAB ENTRY.
b.Address_in_work_area := address of work_area + translated_addresst_origin.
c.Add relocation_factor to the operand address in the word with the address address_in_work_area.
6.Program_linked_origin=program_linked_origin + OM_size.

No comments:

Post a Comment