Skip to content

Commit 48d5ce0

Browse files
fix(musl): DT_STRTAB of Musl is offset based on link_map->l_addr
But DT_STRTAB of Glibc is absolute address.
1 parent 63a00ed commit 48d5ce0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

driver/euicc-driver-loader.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ static char *get_runpath() {
148148
} else if (dyn->d_tag == DT_RUNPATH) {
149149
runpath = dyn;
150150
} else if (dyn->d_tag == DT_STRTAB) {
151+
#if defined(__GLIBC__)
151152
strtab = (const char *)dyn->d_un.d_ptr;
153+
#else
154+
strtab = (const char *)(linkmap->l_addr + dyn->d_un.d_val);
155+
#endif
152156
}
153157
}
154158
if (runpath != NULL && strtab != NULL) {

0 commit comments

Comments
 (0)