about summary refs log tree commit diff stats
path: root/src/elfs/elfloader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/elfs/elfloader.c')
-rwxr-xr-xsrc/elfs/elfloader.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c
index afd9002d..c5f59375 100755
--- a/src/elfs/elfloader.c
+++ b/src/elfs/elfloader.c
@@ -1081,6 +1081,20 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, needed_libs_t* neededlibs, lib
                 rpath = tmp;
                 free(origin);
             }
+            while(strstr(rpath, "${PLATFORM}")) {
+                char* platform = strdup("x86_64");
+                char* p = strrchr(platform, '/');
+                if(p) *p = '\0';    // remove file name to have only full path, without last '/'
+                char* tmp = (char*)calloc(1, strlen(rpath)-strlen("${PLATFORM}")+strlen(platform)+1);
+                p = strstr(rpath, "${PLATFORM}");
+                memcpy(tmp, rpath, p-rpath);
+                strcat(tmp, platform);
+                strcat(tmp, p+strlen("${PLATFORM}"));
+                if(rpath!=rpathref)
+                    free(rpath);
+                rpath = tmp;
+                free(platform);
+            }
             if(strchr(rpath, '$')) {
                 printf_log(LOG_INFO, "BOX64: Warning, RPATH with $ variable not supported yet (%s)\n", rpath);
             } else {