Make it compile again by adding a more portable setfold.sh script.

committer: mfx <mfx> 962038500 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-06-26 16:55:00 +00:00
parent 9be680108e
commit aba09d07c9
11 changed files with 97 additions and 51 deletions
+5 -1
View File
@@ -29,7 +29,11 @@ $fname = shift || die;
sysopen (FH,$fname,2) || die;
binmode FH;
$val = oct shift || die;
$val = shift || die "$val";
###print STDERR "$val\n";
$val = oct($val); # acutally hex()
###print STDERR "$val\n";
die unless $val;
$num = pack("V", $val);
# 0x34 = sizeof(Elf32_Ehdr)
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -e
file="$1"
# get directory of this script
bindir=`echo "$0" | sed -e 's|[^/][^/]*$||'`
bindir=`cd "$bindir" && pwd`
sstrip="$bindir/../util/sstrip/sstrip"
# get address of symbol "fold_begin"
fold=`nm -f bsd "$file" | grep fold_begin | sed 's/^0*\([0-9a-fA-F]*\).*/0x\1/'`
# strip
objcopy -S -R .comment -R .note "$file"
"$sstrip" "$file"
# patch address
perl -w "$bindir/setfold.pl" "$file" "$fold"
exit 0