summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2001-10-10 07:15:01 +0000
committerdfr <dfr@FreeBSD.org>2001-10-10 07:15:01 +0000
commiteb9de058747f8f748c37fa927feff82887fc490b (patch)
tree371fd1e27cb138e505232cfeb9ed821ec92313a4 /libexec
parentf868b9c47960524d92db14074160719f0443e89d (diff)
downloadFreeBSD-src-eb9de058747f8f748c37fa927feff82887fc490b.zip
FreeBSD-src-eb9de058747f8f748c37fa927feff82887fc490b.tar.gz
The support for accelerating find_symdef() with a cache was broken. This
fixes the problem and improves startup times for large applications such as KDE2 considerably. Reviewed by: jdp MFC after: 1 week
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/alpha/reloc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libexec/rtld-elf/alpha/reloc.c b/libexec/rtld-elf/alpha/reloc.c
index f963476..823e388 100644
--- a/libexec/rtld-elf/alpha/reloc.c
+++ b/libexec/rtld-elf/alpha/reloc.c
@@ -68,14 +68,10 @@ extern Elf_Dyn _DYNAMIC;
/* Relocate a non-PLT object with addend. */
static int
-reloc_non_plt_obj(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela)
+reloc_non_plt_obj(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela,
+ SymCache *cache)
{
Elf_Addr *where = (Elf_Addr *) (obj->relocbase + rela->r_offset);
- SymCache *cache;
-
- cache = (SymCache *)alloca(obj->nchains * sizeof(SymCache));
- if (cache != NULL)
- memset(cache, 0, obj->nchains * sizeof(SymCache));
switch (ELF_R_TYPE(rela->r_info)) {
@@ -155,6 +151,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
const Elf_Rel *rel;
const Elf_Rela *relalim;
const Elf_Rela *rela;
+ SymCache *cache;
+
+ cache = (SymCache *)alloca(obj->nchains * sizeof(SymCache));
+ if (cache != NULL)
+ memset(cache, 0, obj->nchains * sizeof(SymCache));
/* Perform relocations without addend if there are any: */
rellim = (const Elf_Rel *) ((caddr_t) obj->rel + obj->relsize);
@@ -164,14 +165,14 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
locrela.r_info = rel->r_info;
locrela.r_offset = rel->r_offset;
locrela.r_addend = 0;
- if (reloc_non_plt_obj(obj_rtld, obj, &locrela))
+ if (reloc_non_plt_obj(obj_rtld, obj, &locrela, cache))
return -1;
}
/* Perform relocations with addend if there are any: */
relalim = (const Elf_Rela *) ((caddr_t) obj->rela + obj->relasize);
for (rela = obj->rela; obj->rela != NULL && rela < relalim; rela++) {
- if (reloc_non_plt_obj(obj_rtld, obj, rela))
+ if (reloc_non_plt_obj(obj_rtld, obj, rela, cache))
return -1;
}
return 0;
OpenPOWER on IntegriCloud