mirror of
https://github.com/NixOS/patchelf.git
synced 2025-10-19 19:53:19 +08:00
* --interpreter' ->
--set-interpreter'.
This commit is contained in:
2
README
2
README
@@ -3,7 +3,7 @@ libraries. In particular, it can do the following:
|
|||||||
|
|
||||||
* Change the dynamic loader ("ELF interpreter") of executables:
|
* Change the dynamic loader ("ELF interpreter") of executables:
|
||||||
|
|
||||||
$ patchelf --interpreter /lib/my-ld-linux.so.2 my-program
|
$ patchelf --set-interpreter /lib/my-ld-linux.so.2 my-program
|
||||||
|
|
||||||
* Change the RPATH of executables and libraries:
|
* Change the RPATH of executables and libraries:
|
||||||
|
|
||||||
|
@@ -660,7 +660,7 @@ int main(int argc, char * * argv)
|
|||||||
{
|
{
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
fprintf(stderr, "syntax: %s\n\
|
fprintf(stderr, "syntax: %s\n\
|
||||||
[--interpreter FILENAME]\n\
|
[--set-interpreter FILENAME]\n\
|
||||||
[--print-interpreter]\n\
|
[--print-interpreter]\n\
|
||||||
[--set-rpath RPATH]\n\
|
[--set-rpath RPATH]\n\
|
||||||
[--shrink-rpath]\n\
|
[--shrink-rpath]\n\
|
||||||
@@ -675,7 +675,7 @@ int main(int argc, char * * argv)
|
|||||||
int i;
|
int i;
|
||||||
for (i = 1; i < argc; ++i) {
|
for (i = 1; i < argc; ++i) {
|
||||||
string arg(argv[i]);
|
string arg(argv[i]);
|
||||||
if (arg == "--interpreter") {
|
if (arg == "--set-interpreter" || arg == "--interpreter") {
|
||||||
if (++i == argc) error("missing argument");
|
if (++i == argc) error("missing argument");
|
||||||
newInterpreter = argv[i];
|
newInterpreter = argv[i];
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ cp no-rpath scratch/
|
|||||||
oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath)
|
oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath)
|
||||||
if test -n "$oldRPath"; then exit 1; fi
|
if test -n "$oldRPath"; then exit 1; fi
|
||||||
../src/patchelf \
|
../src/patchelf \
|
||||||
--interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \
|
--set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \
|
||||||
--set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath
|
--set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath
|
||||||
|
|
||||||
newRPath=$(../src/patchelf --print-rpath scratch/no-rpath)
|
newRPath=$(../src/patchelf --print-rpath scratch/no-rpath)
|
||||||
|
@@ -10,7 +10,7 @@ mkdir -p scratch
|
|||||||
|
|
||||||
newInterpreter=$(pwd)/scratch/iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|
newInterpreter=$(pwd)/scratch/iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|
||||||
cp simple scratch/
|
cp simple scratch/
|
||||||
../src/patchelf --interpreter "$newInterpreter" scratch/simple
|
../src/patchelf --set-interpreter "$newInterpreter" scratch/simple
|
||||||
|
|
||||||
echo "running with missing interpreter..."
|
echo "running with missing interpreter..."
|
||||||
if scratch/simple; then
|
if scratch/simple; then
|
||||||
|
@@ -9,7 +9,7 @@ rm -rf scratch
|
|||||||
mkdir -p scratch
|
mkdir -p scratch
|
||||||
|
|
||||||
cp simple scratch/
|
cp simple scratch/
|
||||||
../src/patchelf --interpreter /oops scratch/simple
|
../src/patchelf --set-interpreter /oops scratch/simple
|
||||||
|
|
||||||
echo "running with missing interpreter..."
|
echo "running with missing interpreter..."
|
||||||
if scratch/simple; then
|
if scratch/simple; then
|
||||||
|
Reference in New Issue
Block a user