summaryrefslogtreecommitdiff
path: root/ldso/ldso/powerpc/elfinterp.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-06-27 01:16:10 +0000
committerEric Andersen <andersen@codepoet.org>2004-06-27 01:16:10 +0000
commitc5a41a767d3bd57fa91339b017a55a860d2a05b9 (patch)
treeb98832c059365f280ad727d16f9cfda4f2cdb059 /ldso/ldso/powerpc/elfinterp.c
parent998f870a192c165c53ebf62d896006824e073d60 (diff)
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
Diffstat (limited to 'ldso/ldso/powerpc/elfinterp.c')
-rw-r--r--ldso/ldso/powerpc/elfinterp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c
index e67128b2a..0cecf7dc8 100644
--- a/ldso/ldso/powerpc/elfinterp.c
+++ b/ldso/ldso/powerpc/elfinterp.c
@@ -443,6 +443,11 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
ELF_RELOC *rpnt;
int symtab_index;
+ /* When the dynamic linker bootstrapped itself, it resolved some symbols.
+ Make sure we do not do them again */
+ if (tpnt->libtype == program_interpreter)
+ return 0;
+
/* Now parse the relocation information */
rpnt = (ELF_RELOC *)(intptr_t) (rel_addr + tpnt->loadaddr);
rel_size = rel_size / sizeof(ELF_RELOC);
@@ -455,14 +460,6 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
symtab_index = ELF32_R_SYM(rpnt->r_info);
- /* When the dynamic linker bootstrapped itself, it resolved some symbols.
- Make sure we do not do them again */
- if (!symtab_index && tpnt->libtype == program_interpreter)
- continue;
- if (symtab_index && tpnt->libtype == program_interpreter &&
- _dl_symbol(strtab + symtab[symtab_index].st_name))
- continue;
-
#if defined (__SUPPORT_LD_DEBUG__)
debug_sym(symtab,strtab,symtab_index);
debug_reloc(symtab,strtab,rpnt);