diff options
author | Domen Kožar <domen@dev.si> | 2020-06-03 11:45:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 11:45:12 (GMT) |
commit | 67091ca1f979829df9cdcd3609f72d7e78d8a96a (patch) | |
tree | 0c5caad15b09bc310b0610654927b54f8754e8c3 /src/patchelf.cc | |
parent | f3411a986e0d4869786cacc1e018f13d951d22bd (diff) | |
parent | 6e5e98ce774e728290680c46b44da86246f1d167 (diff) | |
download | patchelf-67091ca1f979829df9cdcd3609f72d7e78d8a96a.zip patchelf-67091ca1f979829df9cdcd3609f72d7e78d8a96a.tar.gz patchelf-67091ca1f979829df9cdcd3609f72d7e78d8a96a.tar.bz2 |
Merge pull request #137 from speleo3/force-rpath-94
Consistently use --force-rpath
Diffstat (limited to 'src/patchelf.cc')
-rw-r--r-- | src/patchelf.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc index d560587..80d40ab 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -1259,7 +1259,17 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, } - if (std::string(rpath ? rpath : "") == newRPath) return; + if (!forceRPath && dynRPath && !dynRunPath) { /* convert DT_RPATH to DT_RUNPATH */ + dynRPath->d_tag = DT_RUNPATH; + dynRunPath = dynRPath; + dynRPath = 0; + } else if (forceRPath && dynRunPath) { /* convert DT_RUNPATH to DT_RPATH */ + dynRunPath->d_tag = DT_RPATH; + dynRPath = dynRunPath; + dynRunPath = 0; + } else if (std::string(rpath ? rpath : "") == newRPath) { + return; + } changed = true; @@ -1273,15 +1283,6 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, debug("new rpath is '%s'\n", newRPath.c_str()); - if (!forceRPath && dynRPath && !dynRunPath) { /* convert DT_RPATH to DT_RUNPATH */ - dynRPath->d_tag = DT_RUNPATH; - 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()); |