-
-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from crystax/master
Add --print-os-abi and --set-os-abi options
- Loading branch information
Showing
5 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#! /bin/sh -e | ||
|
||
SCRATCH=scratch/$(basename $0 .sh) | ||
|
||
rm -rf ${SCRATCH} | ||
mkdir -p ${SCRATCH} | ||
|
||
cp simple-pie ${SCRATCH}/simple-pie | ||
|
||
# Save the old OS ABI | ||
OLDABI=`../src/patchelf --print-os-abi ${SCRATCH}/simple-pie` | ||
# Ensure it's not empty | ||
test -n "$OLDABI" | ||
|
||
# Change OS ABI and verify it has been changed | ||
{ | ||
echo "System V" | ||
echo "HP-UX" | ||
echo "NetBSD" | ||
echo "Linux" | ||
echo "GNU Hurd" | ||
echo "Solaris" | ||
echo "AIX" | ||
echo "IRIX" | ||
echo "FreeBSD" | ||
echo "Tru64" | ||
echo "OpenBSD" | ||
echo "OpenVMS" | ||
} | { | ||
while IFS="\n" read ABI; do | ||
echo "Set OS ABI to '$ABI'..." | ||
../src/patchelf --set-os-abi "$ABI" ${SCRATCH}/simple-pie | ||
|
||
echo "Check is OS ABI is '$ABI'..." | ||
NEWABI=`../src/patchelf --print-os-abi ${SCRATCH}/simple-pie` | ||
test "$NEWABI" = "$ABI" | ||
done | ||
} | ||
|
||
# Reset OS ABI to the saved one | ||
../src/patchelf --set-os-abi "$OLDABI" ${SCRATCH}/simple-pie | ||
|
||
# Verify we still can run the executable | ||
${SCRATCH}/simple-pie |