-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
feat: add --no-clobber-old-sections switch #521
Conversation
824acdb
to
6eaa2e9
Compare
6eaa2e9
to
2490a52
Compare
src/patchelf.cc
Outdated
@@ -2505,6 +2508,7 @@ static void showHelp(const std::string & progName) | |||
[--clear-execstack]\n\ | |||
[--set-execstack]\n\ | |||
[--rename-dynamic-symbols NAME_MAP_FILE]\tRenames dynamic symbols. The map file should contain two symbols (old_name new_name) per line\n\ | |||
[--no-clobber-old-sections]\t\tDo not clobber old section values - only use when executable does self-referential tricks.\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are self-referential tricks? Can you add more details here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically anything that relies on things remaining at the same offset in the binary.
src/patchelf.cc
Outdated
@@ -2505,6 +2508,7 @@ static void showHelp(const std::string & progName) | |||
[--clear-execstack]\n\ | |||
[--set-execstack]\n\ | |||
[--rename-dynamic-symbols NAME_MAP_FILE]\tRenames dynamic symbols. The map file should contain two symbols (old_name new_name) per line\n\ | |||
[--no-clobber-old-sections]\t\tDo not clobber old section values - only use when executable does self-referential tricks.\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[--no-clobber-old-sections]\t\tDo not clobber old section values - only use when executable does self-referential tricks.\n\ | |
[--no-clobber-old-sections]\t\tDo not clobber old section values - only use when executables rely on sections remain at the same offset in the binary.\n\ |
2490a52
to
a633430
Compare
How's this phrasing? |
Better. Could you also update https://github.com/NixOS/patchelf/blob/master/patchelf.1 ? |
Works around NixOS#520, may be useful for other cursed self-modifying things.
a633430
to
4f710cb
Compare
Done. Tried to elaborate a bit on the behavior in the man page too. |
Works around #520, may be useful for other cursed self-modifying things.