]> granicus.if.org Git - openssl/commitdiff
fips_canister.c: more cross-compiler platfroms verified.
authorAndy Polyakov <appro@openssl.org>
Wed, 19 Oct 2011 21:05:53 +0000 (21:05 +0000)
committerAndy Polyakov <appro@openssl.org>
Wed, 19 Oct 2011 21:05:53 +0000 (21:05 +0000)
fips/fips_canister.c

index 8a3524952e6deae06fee71bc95f5b7b0cd138c02..4f187948a23368aed1e096af9cb5761c5027e81a 100644 (file)
@@ -30,8 +30,10 @@ const void         *FIPS_text_end(void);
 #if !defined(FIPS_REF_POINT_IS_CROSS_COMPILER_AWARE)
 # if   (defined(__ANDROID__) && (defined(__arm__) || defined(__arm)    || \
                                  defined(__i386__)|| defined(__i386))) || \
-       (defined(__vxworks)   && (defined(__ppc__) || defined(__ppc)))  || \
-       (defined(__linux)     && defined(__PPC__) && !defined(__PPC64__))
+       (defined(__vxworks)   && (defined(__ppc__) || defined(__ppc)    || \
+                                 defined(__mips__)|| defined(__mips))) || \
+       (defined(__linux)     && ((defined(__PPC__) && !defined(__PPC64__)) || \
+                                 defined(__arm__) || defined(__arm)))
 #  define FIPS_REF_POINT_IS_CROSS_COMPILER_AWARE
 # endif
 #endif
@@ -166,7 +168,11 @@ static void *instruction_pointer(void)
 const void *FIPS_ref_point()
 {
 #if    defined(FIPS_REF_POINT_IS_CROSS_COMPILER_AWARE)
+# if defined(__thumb__) || defined(__thumb)
+    return (void *)((size_t)instruction_pointer&~1);
+# else
     return (void *)instruction_pointer;
+# endif
 #elif  defined(INSTRUCTION_POINTER_IMPLEMENTED)
     return instruction_pointer();
 /* Below we essentially cover vendor compilers which do not support