Research Article

A Migration Method of MPI Program Combining Local Library Replacement and Instruction Translation

Algorithm 2

Automatic extraction algorithm of library function information.
//function: identify and store dynamic linked library
function when loading executable file
//input: executable file handle, .sym section head,
 .rel.plt section pointer, .plt section pointer
//output: library function message queue (func_info)
init func_info
set null func_info
Foreach elf_rel_plt in  .rel.plt
 create a rela_plt_func_info object
 func_addr = extract the offset address of elf_rel_plt
 func_name = extract the  .sym name
Endfor
Foreach elf_plt in  .plt
 add_var = 32-bit data after moving the elf_plt address
16 bits to right + elf_plt address + 6
if (func_addr == add_var)
func_call_addr = elf_plt address + index (unit width)
Endfor