diff options
Diffstat (limited to 'ldso/ldso/dl-elf.c')
-rw-r--r-- | ldso/ldso/dl-elf.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 2bcfcda64..4f50d62b7 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -182,7 +182,10 @@ search_for_named_library(const char *name, unsigned int rflags, const char *path } else { _dl_strcpy(mylibname, "."); } - _dl_strcat(mylibname, "/"); + plen = _dl_strlen(mylibname); + if ((plen == 0) || (mylibname[plen-1] != '/')) { + _dl_strcat(mylibname, "/"); + } _dl_strcat(mylibname, name); #ifdef __LDSO_SAFE_RUNPATH__ if (*mylibname == '/') @@ -897,7 +900,8 @@ struct elf_resolve *_dl_load_elf_shared_library(unsigned int rflags, _dl_memset(*rpnt, 0, sizeof(struct dyn_elf)); } #endif - (*rpnt)->dyn = tpnt; + if (*rpnt) + (*rpnt)->dyn = tpnt; tpnt->usage_count++; if (tpnt->rtld_flags & RTLD_NODELETE) tpnt->usage_count++; @@ -1024,6 +1028,11 @@ int _dl_fixup(struct dyn_elf *rpnt, struct r_scope_elem *scope, int now_flag) return goof; } +#if !defined(__FDPIC__) && !defined(__DSBT__) + /* Process DT_RELR relative relocations */ + DL_RELOCATE_RELR(tpnt); +#endif + reloc_size = tpnt->dynamic_info[DT_RELOC_TABLE_SIZE]; /* On some machines, notably SPARC & PPC, DT_REL* includes DT_JMPREL in its range. Note that according to the ELF spec, this is completely legal! */ |