diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-11-23 16:17:57 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-03-30 01:41:33 -0400 |
commit | 5c34041293ae1c8aa2ddbd27eca662652f56b790 (patch) | |
tree | bc5218128bdbf03c1a3931ac97be96a0c4dc0263 | |
parent | 395e409cc0b89faeaae8d701a18105d020f7aade (diff) | |
download | musl-5c34041293ae1c8aa2ddbd27eca662652f56b790.tar.gz musl-5c34041293ae1c8aa2ddbd27eca662652f56b790.tar.bz2 musl-5c34041293ae1c8aa2ddbd27eca662652f56b790.tar.xz musl-5c34041293ae1c8aa2ddbd27eca662652f56b790.zip |
adapt dynamic linker for new binutils versions that omit DT_RPATH
the new DT_RUNPATH semantics for search order are always used, and
since binutils had always set both DT_RPATH and DT_RUNPATH when the
latter was used, processing only DT_RPATH worked fine. however, recent
binutils has stopped generating DT_RPATH when DT_RUNPATH is used,
which broke support for this feature completely.
(cherry picked from commit d8dc2b7c0289b12eeef4feff65e3c918111b0f55)
-rw-r--r-- | src/ldso/dynlink.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 6d265b35..cc84c8ab 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -517,6 +517,8 @@ static void decode_dyn(struct dso *p) p->hashtab = (void *)(p->base + dyn[DT_HASH]); if (dyn[0]&(1<<DT_RPATH)) p->rpath_orig = (void *)(p->strings + dyn[DT_RPATH]); + if (dyn[0]&(1<<DT_RUNPATH)) + p->rpath_orig = (void *)(p->strings + dyn[DT_RUNPATH]); if (search_vec(p->dynv, dyn, DT_GNU_HASH)) p->ghashtab = (void *)(p->base + *dyn); if (search_vec(p->dynv, dyn, DT_VERSYM)) |