Skip to content

Commit 719d377

Browse files
fix(driver-loader): check DT_RPATH if DT_RUNPATH unavailable
Will happen on old systems. Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
1 parent ce4abfa commit 719d377

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

driver/euicc-driver-loader.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,14 @@ static char *get_runpath() {
155155
# endif
156156
}
157157
}
158-
if (runpath != NULL && strtab != NULL) {
158+
if (strtab == NULL) {
159+
return NULL;
160+
}
161+
if (runpath != NULL) {
159162
return strdup(strtab + runpath->d_un.d_val);
163+
} else if (rpath != NULL) {
164+
// On old system, RPATH was used instead of RUNPATH.
165+
return strdup(strtab + rpath->d_un.d_val);
160166
} else {
161167
return NULL;
162168
}

0 commit comments

Comments
 (0)