Skip to content

Commit

Permalink
[bugfix] fix canary support for functions with ASM inline
Browse files Browse the repository at this point in the history
  • Loading branch information
PThierry committed Mar 6, 2020
1 parent 2c5a603 commit d7d762e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions arch/cores/armv7-m/m4_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int _main(uint32_t slot);
#pragma clang optimize off
/* Well, clang support local stack protection deactivation only since v8 :-/ */
#if __clang_major__ > 7
#pragma clang attribute push(__attribute__((no_stack_protector)), apply_to = do_starttask)
#pragma clang attribute push(__attribute__((no_stack_protector)))
#endif
#endif

Expand Down Expand Up @@ -72,17 +72,6 @@ __IN_SEC_VDSO void __stack_chk_fail(void)
};
}

#if __clang__
#pragma clang optimize on
#if __clang_major__ > 7
#pragma clang attribute pop
#endif
#endif

#if __GNUC__
#pragma GCC pop_options
#endif

/**
** \private
** ISR handler glue. The kernel must set the real handler @ in the
Expand Down Expand Up @@ -278,3 +267,15 @@ __IN_SEC_VDSO e_syscall_ret do_syscall(e_svc_type svc, __attribute__ ((unused))
return SYS_E_INVAL;
}
}

#if __clang__
#pragma clang optimize on
#if __clang_major__ > 7
#pragma clang attribute pop
#endif
#endif

#if __GNUC__
#pragma GCC pop_options
#endif

0 comments on commit d7d762e

Please sign in to comment.