Mercurial > hg > graal-compiler
annotate test/runtime/7107135/Test7107135.sh @ 10686:73122b5edf6a
SPARC: Can compile simple methods and do static calls.
author | twisti |
---|---|
date | Tue, 09 Jul 2013 15:37:50 -0700 |
parents | 04d6d4322c6a |
children | f9ee986a9fea |
rev | line source |
---|---|
8710
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
1 #!/bin/sh |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
2 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
3 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
4 # Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
5 # Copyright (c) 2011 SAP AG. All Rights Reserved. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
7 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
8 # This code is free software; you can redistribute it and/or modify it |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
9 # under the terms of the GNU General Public License version 2 only, as |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
10 # published by the Free Software Foundation. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
11 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
12 # This code is distributed in the hope that it will be useful, but WITHOUT |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
15 # version 2 for more details (a copy is included in the LICENSE file that |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
16 # accompanied this code). |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
17 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
18 # You should have received a copy of the GNU General Public License version |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
19 # 2 along with this work; if not, write to the Free Software Foundation, |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
21 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
23 # or visit www.oracle.com if you need additional information or have any |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
24 # questions. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
25 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
26 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
27 ## |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
28 ## @test Test7107135.sh |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
29 ## @bug 7107135 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
30 ## @summary Stack guard pages lost after loading library with executable stack. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
31 ## @run shell Test7107135.sh |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
32 ## |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
33 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
34 if [ "${TESTSRC}" = "" ] |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
35 then |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
36 TESTSRC=${PWD} |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
37 echo "TESTSRC not set. Using "${TESTSRC}" as default" |
8710
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
38 fi |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
39 echo "TESTSRC=${TESTSRC}" |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
40 ## Adding common setup Variables for running shell tests. |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
41 . ${TESTSRC}/../../test_env.sh |
8710
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
42 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
43 # set platform-dependent variables |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
44 OS=`uname -s` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
45 case "$OS" in |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
46 Linux) |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
47 echo "Testing on Linux" |
8710
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
48 ;; |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
49 *) |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
50 NULL=NUL |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
51 PS=";" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
52 FS="\\" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
53 echo "Test passed; only valid for Linux" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
54 exit 0; |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
55 ;; |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
56 esac |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
57 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
58 ARCH=`uname -m` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
59 |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
8710
diff
changeset
|
60 THIS_DIR=. |
8710
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
61 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
62 cp ${TESTSRC}${FS}*.java ${THIS_DIR} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
63 ${TESTJAVA}${FS}bin${FS}javac *.java |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
64 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
65 gcc -fPIC -shared -c -o test.o -I${TESTJAVA}${FS}include -I${TESTJAVA}${FS}include${FS}linux ${TESTSRC}${FS}test.c |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
66 ld -shared -z execstack -o libtest-rwx.so test.o |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
67 ld -shared -z noexecstack -o libtest-rw.so test.o |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
68 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
69 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
70 LD_LIBRARY_PATH=${THIS_DIR} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
71 echo LD_LIBRARY_PATH = ${LD_LIBRARY_PATH} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
72 export LD_LIBRARY_PATH |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
73 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
74 # This should not fail. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
75 echo Check testprogram. Expected to pass: |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
76 echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
77 ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
78 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
79 echo |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
80 echo Test changing of stack protection: |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
81 echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
82 ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
83 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
84 if [ "$?" == "0" ] |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
85 then |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
86 echo |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
87 echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
88 ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
89 fi |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
90 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
91 exit $? |