Subject: Re: 'prebind' implementation (was Re: HEADS UP: migration to fully dynamic linked "base" system)
To: Bang Jun-Young <>
From: Jason R Thorpe <>
List: tech-userlevel
Date: 08/28/2002 07:36:14
On Wed, Aug 28, 2002 at 09:28:26PM +0900, Bang Jun-Young wrote:

 > More thoughts on prebinding:
 >  - '.pgot' would be better than '.pplt'. First, '.got' is mapped 
 >    read-writable but '.plt' read-only, and second, it's much easier to
 >    deal with GOT entries than PLT entries. '.plt' is code section so
 >    you should know how jmp instruction is encoded for each archtecture. 

Err, either way, you should be able to lift the code for the relocations,
for both PLT and GOT objects, from ld.elf_so ... in fact, I'd think that
you'd want to share as much code as possible...

Sure, PLT entires are generally lazy-bound, but it would still be a
performance benefit to pre-bind them, yes?

 >  - Save base addresses of shared objects in some place of the binary,
 >    and if they are different than actual base addresses of shared objects
 >    mapped in memory, dynamic linker performs additional fixup process by
 >    adding/subtracting delta to/from each entry in '.pgot'. This would
 >    be simple and not be a time-taking job. 

Hm, yah, that sounds like a good idea.

        -- Jason R. Thorpe <>