diff options
Diffstat (limited to 'src/patchelf.cc')
-rw-r--r-- | src/patchelf.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc index 9b17192..58404d9 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -205,6 +205,9 @@ I ElfFile<ElfFileParamNames>::rdi(I i) #define DT_GNU_HASH 0x6ffffef5 #endif +/* Ugly: used to erase DT_RUNPATH when using --force-rpath. */ +#define DT_IGNORE 0x00726e67 + static void debug(const char * format, ...) { @@ -959,6 +962,10 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, string newRPath) dynRunPath = dynRPath; dynRPath = 0; } + + if (forceRPath && dynRPath && dynRunPath) { /* convert DT_RUNPATH to DT_RPATH */ + dynRunPath->d_tag = DT_IGNORE; + } if (newRPath.size() <= rpathSize) { strcpy(rpath, newRPath.c_str()); |