From: Yu Watanabe Date: Sat, 6 Sep 2025 03:06:06 +0000 (+0900) Subject: musl: build-path: fix reading DT_RUNPATH or DT_RPATH X-Git-Tag: v259-rc1~71^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b774c740ba35d16c8a32d66d8bd5747c03d0d1a;p=thirdparty%2Fsystemd.git musl: build-path: fix reading DT_RUNPATH or DT_RPATH musl records DT_STRTAB as offset, rather than address. So, need to add obtained bias to read runpath or rpath. --- diff --git a/src/basic/build-path.c b/src/basic/build-path.c index 577ff72bce2..32120893792 100644 --- a/src/basic/build-path.c +++ b/src/basic/build-path.c @@ -34,11 +34,11 @@ static int get_runpath_from_dynamic(const ElfW(Dyn) *d, ElfW(Addr) bias, const c break; case DT_STRTAB: - /* On MIPS and RISC-V DT_STRTAB records an offset, not a valid address, so it has to be adjusted - * using the bias calculated earlier. */ + /* On MIPS, RISC-V, or with musl, DT_STRTAB records an offset, not a valid address, + * so it has to be adjusted using the bias calculated earlier. */ if (d->d_un.d_val != 0) strtab = (const char *) ((uintptr_t) d->d_un.d_val -#if defined(__mips__) || defined(__riscv) +#if defined(__mips__) || defined(__riscv) || !defined(__GLIBC__) + bias #endif );