]>
Commit | Line | Data |
---|---|---|
d6e5e940 AT |
1 | dnl |
2 | dnl Check for -z now and -z relro linker flags | |
3 | dnl | |
4 | dnl Copyright (C) 2013 Red Hat, Inc. | |
5 | dnl | |
6 | dnl This library is free software; you can redistribute it and/or | |
7 | dnl modify it under the terms of the GNU Lesser General Public | |
8 | dnl License as published by the Free Software Foundation; either | |
9 | dnl version 2.1 of the License, or (at your option) any later version. | |
10 | dnl | |
11 | dnl This library is distributed in the hope that it will be useful, | |
12 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | dnl Lesser General Public License for more details. | |
15 | dnl | |
16 | dnl You should have received a copy of the GNU Lesser General Public | |
17 | dnl License along with this library. If not, see | |
18 | dnl <http://www.gnu.org/licenses/>. | |
19 | dnl | |
20 | ||
21 | AC_DEFUN([AC_LD_RELRO],[ | |
22 | AC_MSG_CHECKING([for how to force completely read-only GOT table]) | |
23 | ||
24 | RELRO_LDFLAGS= | |
cc8ac2e9 | 25 | ld_help=`$CXX -Wl,-help 2>&1` |
d6e5e940 AT |
26 | case $ld_help in |
27 | *"-z relro"*) RELRO_LDFLAGS="-Wl,-z -Wl,relro" ;; | |
28 | esac | |
29 | case $ld_help in | |
30 | *"-z now"*) RELRO_LDFLAGS="$RELRO_LDFLAGS -Wl,-z -Wl,now" ;; | |
31 | esac | |
32 | AC_SUBST([RELRO_LDFLAGS]) | |
d9151447 RK |
33 | AS_IF([test "x$RELRO_LDFLAGS" != "x"], |
34 | [AC_MSG_RESULT([$RELRO_LDFLAGS])], | |
35 | [AC_MSG_RESULT([unknown])] | |
36 | ) | |
d6e5e940 | 37 | ]) |