Subject: Re: 'prebind' implementation (was Re: HEADS UP: migration to fully dynamic linked "base" system)
To: Jason R Thorpe <firstname.lastname@example.org>
From: Bang Jun-Young <email@example.com>
Date: 08/29/2002 00:15:36
On Wed, Aug 28, 2002 at 07:36:14AM -0700, Jason R Thorpe wrote:
> 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?
Yes. Especially, prebinding would be of more benefit to small binaries
like those in /bin and /sbin.
> > - 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.
Bang Jun-Young <firstname.lastname@example.org>