Print this page
sync further changes from uts/aslr
*** 44,58 ****
gcc -o many-dts-noaslr tester.c -Wl,-z,aslr=disabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done)
check() {
bin=$1
state=$2
ret=0
$bin &
pid=$!
! psecflags $pid | grep -q 'E:.*aslr'
(( $? != $state )) && ret=1
kill -9 $pid
return $ret
}
--- 44,59 ----
gcc -o many-dts-noaslr tester.c -Wl,-z,aslr=disabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done)
check() {
bin=$1
state=$2
+ set=$3
ret=0
$bin &
pid=$!
! psecflags $pid | grep -q "${set}:.*aslr"
(( $? != $state )) && ret=1
kill -9 $pid
return $ret
}
*** 60,71 ****
echo $@
exit 1
}
psecflags -s none $$
! check ./tester-aslr 0 || fail "DT_SUNW_ASLR 1 failed"
! check ./many-dts-aslr 0 || fail "DT_SUNW_ASLR 1 with many DTs failed"
psecflags -s aslr $$
! check ./tester-noaslr 1 || fail "DT_SUNW_ASLR 0 failed"
! check ./many-dts-noaslr 1 || fail "DT_SUNW_ASLR 0 with many DTs failed"
--- 61,73 ----
echo $@
exit 1
}
psecflags -s none $$
! check ./tester-aslr 0 E || fail "DT_SUNW_ASLR 1 failed"
! check ./many-dts-aslr 0 E || fail "DT_SUNW_ASLR 1 with many DTs failed"
! check ./tester-aslr 1 I || fail "DT_SUNW_ASLR 1 incorrectly set the inheritable flag"
psecflags -s aslr $$
! check ./tester-noaslr 1 E || fail "DT_SUNW_ASLR 0 failed"
! check ./many-dts-noaslr 1 E || fail "DT_SUNW_ASLR 0 with many DTs failed"