Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip overwriting r(un)path data when old_rpath = new_rpath. #231

Merged
merged 1 commit into from Aug 19, 2020

Conversation

rmNULL
Copy link
Contributor

@rmNULL rmNULL commented Aug 19, 2020

patchelf/src/patchelf.cc

Lines 1383 to 1393 in 7aa6b90

if (!forceRPath && dynRPath && !dynRunPath) { /* convert DT_RPATH to DT_RUNPATH */
wri(dynRPath->d_tag, DT_RUNPATH);
dynRunPath = dynRPath;
dynRPath = 0;
} else if (forceRPath && dynRunPath) { /* convert DT_RUNPATH to DT_RPATH */
wri(dynRunPath->d_tag, DT_RPATH);
dynRPath = dynRunPath;
dynRunPath = 0;
} else if (std::string(rpath ? rpath : "") == newRPath) {
return;
}

When the force-rpath is true and DT_RUNPATH exists,
the conditional for old_rpath = new_rpath is not checked.
causing it to rewrite rpath data even when new_rpath = old_rpath.

similar problem when !forceRPath && dynRPath && !dynRunPath is true.

Also handle the case of dyn rpath changed.
@edolstra edolstra merged commit 53a9eb8 into NixOS:master Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants