This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ELF prelinking - 0.0.0alpha


As I'm leaving tomorrow for vacation, I've put what I have so far with ELF
prelinking to

Included in that package are two patches (binutils and glibc) plus the
actual prelink utility.

There is still lots of work to do, namely:
- add undo mode, so that one can convert a prelinked library/binary back
  to the state how it was created by ld
- add verify mode to verify the library has not been mucked with after
  (these two modes together could be used for system verification in
   presence of prelinking)
- the prelink utility currently works in a single library/binary per
  invocation only ATM (library extents are stored in /etc/prelink.cache).
  The desired mode of operation is that it works similarly to ldconfig,
  ie. /etc/prelink.conf gives list of lib paths and the utility prelinks
  all libs in there, then prelinks all binaries
  - a sub-item of this is to check carefully for memory leaks, because
    when all libs will be prelinked by a single program, every memory leak
- although the utility converts .rel*.* sections but .rel*.plt into
  .gnu.reloc while sorting relocs carefully and filling
  DT_RELCOUNT/DT_RELACOUNT, the included glibc patch does not take advantage
  of this yes (if prelinking is successful, it is not that severe, but for
  dlopening etc. it should:
  - cache in _dl_lookup_symbol and _dl_lookup_versioned_symbol last symbol
    lookup (.gnu.reloc section sorting makes sure relocs against the same
    symbol are together)
  - if l_addr == 0 (even during dlopen etc.), check if DT_REL{,A}COUNT is
    non-zero and if yes and last non-PLT reloc is of R_*_RELATIVE type,
    then it can skip all relocs from non-PLT-reloc-count - DT_REL{,A}COUNT + 1
    up (e.g. for my glibc there are 300 non-relative relocs first, then
    DT_RELACOUNT=1627 R_386_RELATIVE relocs, so if prelinking cannot be
    used but glibc is successfully mmaped where it wants, then 1627 relocs
    can be cheaply skipped)
- once the above is done, the program needs more ports beyond i386 and
    any time more testing


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]