prelink

来源:互联网 发布:笔记本散热器推荐 知乎 编辑:程序博客网 时间:2024/05/17 06:41

1,improve the starting up speed of and exe.
2, normal process of starting up is
   loading library->link lirary->excute the code (main)
3, Afer prelinking
   loading library -> excute the code
4, prelink is and programe whose input is the exe.

 

1,in order for prelink to be useful, you need to have all your libraries compiled with fPIC, and be running glibc 2.3.1 or higher

2, can cause large performance boosts. It avoids a lot of calls to mmap that have to be done in the dynamic linking process. 

3,prelink is a program which modifies ELF shared libraries and ELF dynam-
  ically linked binaries
4, stores the relocations into the ELF object. 

prelink first collects ELF binaries which should be prelinked and all
  the ELF shared libraries they depend on. Then it assigns a unique vir-
  tual address space slot for each library and relinks the shared library
  to that base address. When the dynamic linker attempts to load such a
  library, unless that virtual address space slot is already occupied, it
  will map it into the given slot. After this is done, prelink with the
  help of dynamic linker resolves all relocations in the binary or
  library against its dependant libraries and stores the relocations into
  the ELF object. It also stores a list of all dependant libraries
  together with their checksums into the binary or library. For bina-
  ries, it also computes a list of conflicts (relocations which resolve
  differently in the binary’s symbol search scope than in the smaller
  search scope in which the dependant library was resolved) and stores it
  into a special ELF section.

  At runtime, the dynamic linker first checks whether all dependant
  libraries were successfully mapped into their designated address space
  slots and whether they have not changed since the prelinking was done.
  If all checks are successful, the dynamic linker just replays the list
  of conflicts (which is usually significantly shorter than total number
  of relocations) instead of relocating each library.

ELF Prelinking

http://www.crast.us/james/articles/prelink.php


Prelink--一种Linux下加速程序启动的技术研究
Prelink
http://www.linuxcommand.org/man_pages/prelink8.html
Gentoo Linux Prelink Guide
http://www.gentoo.org/doc/en/prelink-howto.xml
编译ARM版Prelink(absurd)
http://blog.csdn.net/absurd/archive/2007/04/10/1559598.aspx

原创粉丝点击