OSDN Git Service

Joakim Tjernlund writes:
authorEric Andersen <andersen@codepoet.org>
Sun, 27 Jun 2004 01:16:10 +0000 (01:16 -0000)
committerEric Andersen <andersen@codepoet.org>
Sun, 27 Jun 2004 01:16:10 +0000 (01:16 -0000)
commitc5a41a767d3bd57fa91339b017a55a860d2a05b9
treeb98832c059365f280ad727d16f9cfda4f2cdb059
parent998f870a192c165c53ebf62d896006824e073d60
Joakim Tjernlund writes:

Hi yet again :)

in dl-startup.c when performing boot strap relocation the following test
exists to make sure that only "_dl_" symbols are relocated:
/* We only do a partial dynamic linking right now.  The user
 is not supposed to define any symbols that start with a
 '_dl', so we can do this with confidence. */
 if (!symname || !_dl_symbol(symname)) {
        continue;
 }

However on PPC(and the other archs as well I suspect) all symbols are
"_dl_" symbols so the test is never true. The test can be removed and the
whole loop simplified(smaller). This also makes it possible to
simplify elfinterp.c

This remove the scanning of ldso.so relocs, making relocation faster.

I have tested this on PPC and it works well.
Do you think this optimization will work for the other arches as well?
I can't see why not.

     Jocke

* Tested on x86, arm, mipsel, and powerpc by Erik and works nicely
 -Erik
ldso/ldso/arm/elfinterp.c
ldso/ldso/dl-startup.c
ldso/ldso/i386/elfinterp.c
ldso/ldso/mips/elfinterp.c
ldso/ldso/powerpc/elfinterp.c