diff options
author | Pavel Chupin <pavel.v.chupin@intel.com> | 2012-08-03 12:37:21 +0400 |
---|---|---|
committer | Pavel Chupin <pavel.v.chupin@intel.com> | 2012-08-06 12:35:29 +0400 |
commit | 57cfd7a03820d1241333e059feda0ab04829f575 (patch) | |
tree | 2269f21b323b196acd3bcd7404af33862596fc1f /gcc-4.6 | |
parent | 5f2f4ef69e2f64970aad2c303a529c49789021d8 (diff) | |
download | toolchain_gcc-57cfd7a03820d1241333e059feda0ab04829f575.tar.gz toolchain_gcc-57cfd7a03820d1241333e059feda0ab04829f575.tar.bz2 toolchain_gcc-57cfd7a03820d1241333e059feda0ab04829f575.zip |
Backport from trunk r189840: stack-protector runtime fix
2012-07-25 Sergey Melnikov <sergey.melnikov@intel.com>
* config/i386/i386.md (stack_protect_set): Disable the pattern
for Android since Android libc (bionic) does not provide random
value for stack protection guard at gs:0x14. Guard value
will be provided from external symbol (default implementation).
(stack_protect_set_<mode>): Likewise.
(stack_protect_test): Likewise.
(stack_protect_test_<mode>): Likewise.
* gcc/defaults.h: Define macro TARGET_HAS_BIONIC to 0 - target
* does
not have Bionic by default
* config/linux.h: Redefine macro TARGET_HAS_BIONIC to
* (OPTION_BIONIC)
Macro OPTION_BIONIC is defined in this file and provides Bionic
accessibility status
Change-Id: I56ae8fd7fef7c21977072e7f3c24b93030f0b813
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Diffstat (limited to 'gcc-4.6')
-rw-r--r-- | gcc-4.6/gcc/config/i386/i386.md | 8 | ||||
-rw-r--r-- | gcc-4.6/gcc/config/linux.h | 4 | ||||
-rw-r--r-- | gcc-4.6/gcc/defaults.h | 5 |
3 files changed, 13 insertions, 4 deletions
diff --git a/gcc-4.6/gcc/config/i386/i386.md b/gcc-4.6/gcc/config/i386/i386.md index b1d7e5eba..cc5b76aea 100644 --- a/gcc-4.6/gcc/config/i386/i386.md +++ b/gcc-4.6/gcc/config/i386/i386.md @@ -17955,7 +17955,7 @@ (define_expand "stack_protect_set" [(match_operand 0 "memory_operand" "") (match_operand 1 "memory_operand" "")] - "" + "!TARGET_HAS_BIONIC" { rtx (*insn)(rtx, rtx); @@ -17979,7 +17979,7 @@ (unspec:P [(match_operand:P 1 "memory_operand" "m")] UNSPEC_SP_SET)) (set (match_scratch:P 2 "=&r") (const_int 0)) (clobber (reg:CC FLAGS_REG))] - "" + "!TARGET_HAS_BIONIC" "mov{<imodesuffix>}\t{%1, %2|%2, %1}\;mov{<imodesuffix>}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2" [(set_attr "type" "multi")]) @@ -17997,7 +17997,7 @@ [(match_operand 0 "memory_operand" "") (match_operand 1 "memory_operand" "") (match_operand 2 "" "")] - "" + "!TARGET_HAS_BIONIC" { rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG); @@ -18027,7 +18027,7 @@ (match_operand:P 2 "memory_operand" "m")] UNSPEC_SP_TEST)) (clobber (match_scratch:P 3 "=&r"))] - "" + "!TARGET_HAS_BIONIC" "mov{<imodesuffix>}\t{%1, %3|%3, %1}\;xor{<imodesuffix>}\t{%2, %3|%3, %2}" [(set_attr "type" "multi")]) diff --git a/gcc-4.6/gcc/config/linux.h b/gcc-4.6/gcc/config/linux.h index a1711dc45..4e211127b 100644 --- a/gcc-4.6/gcc/config/linux.h +++ b/gcc-4.6/gcc/config/linux.h @@ -100,3 +100,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Whether we have sincos that follows the GNU extension. */ #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) + +/* Whether we have Bionic libc runtime */ +#undef TARGET_HAS_BIONIC +#define TARGET_HAS_BIONIC (OPTION_BIONIC) diff --git a/gcc-4.6/gcc/defaults.h b/gcc-4.6/gcc/defaults.h index 815ddd243..1ed352f39 100644 --- a/gcc-4.6/gcc/defaults.h +++ b/gcc-4.6/gcc/defaults.h @@ -987,6 +987,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define TARGET_HAS_SINCOS 0 #endif +/* Determin whether the target runtime library is Bionic */ +#ifndef TARGET_HAS_BIONIC +#define TARGET_HAS_BIONIC 0 +#endif + /* Indicate that CLZ and CTZ are undefined at zero. */ #ifndef CLZ_DEFINED_VALUE_AT_ZERO #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0 |