From 552e412abcf7828ef5598302b25812ce3e2cd03f Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Wed, 19 Oct 2011 21:05:53 +0000 Subject: [PATCH] fips_canister.c: more cross-compiler platfroms verified. --- fips/fips_canister.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fips/fips_canister.c b/fips/fips_canister.c index 8a3524952e..4f187948a2 100644 --- a/fips/fips_canister.c +++ b/fips/fips_canister.c @@ -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 -- 2.25.1