Bug#816467: Converting DT_RUNPATH to DT_RPATH

2016-03-02 Thread Felipe Sateler
Control: forwarded -1 https://github.com/NixOS/patchelf/pull/56


On 1 March 2016 at 22:29, djcj  wrote:
> Package: patchelf
> Version: 0.9
>
> DT_RUNPATH won't be converted to DT_RPATH using --force-rpath unless the
> attached patch is used.

Hmm, I'm not sure if --force-rpath is supposed to convert back. The
documentation says it prevents conversion from RPATH to RUNPATH, not
force the conversion the other way.

-- 

Saludos,
Felipe Sateler



Bug#816467: Converting DT_RUNPATH to DT_RPATH

2016-03-01 Thread djcj

Package: patchelf
Version: 0.9

DT_RUNPATH won't be converted to DT_RPATH using --force-rpath unless the 
attached patch is used.
Otherwise the option --force-rpath won't work.

--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -1176,8 +1176,10 @@
 dynRPath = 0;
 }
 
-if (forceRPath && dynRPath && dynRunPath) { /* convert DT_RUNPATH to DT_RPATH */
-dynRunPath->d_tag = DT_IGNORE;
+if (forceRPath && !dynRPath && dynRunPath) { /* convert DT_RUNPATH to DT_RPATH */
+dynRunPath->d_tag = DT_RPATH;
+dynRPath = dynRunPath;
+dynRunPath = 0;
 }
 
 if (newRPath.size() <= rpathSize) {