mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
tools/nolibc: aarch64: add stackprotector support
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
committed by
Paul E. McKenney
parent
443de90314
commit
c1e30f7d38
@@ -172,10 +172,15 @@ struct sys_stat_struct {
|
||||
char **environ __attribute__((weak));
|
||||
const unsigned long *_auxv __attribute__((weak));
|
||||
|
||||
#define __ARCH_SUPPORTS_STACK_PROTECTOR
|
||||
|
||||
/* startup code */
|
||||
void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) _start(void)
|
||||
void __attribute__((weak,noreturn,optimize("omit-frame-pointer"),no_stack_protector)) _start(void)
|
||||
{
|
||||
__asm__ volatile (
|
||||
#ifdef NOLIBC_STACKPROTECTOR
|
||||
"bl __stack_chk_init\n" /* initialize stack protector */
|
||||
#endif
|
||||
"ldr x0, [sp]\n" /* argc (x0) was in the stack */
|
||||
"add x1, sp, 8\n" /* argv (x1) = sp */
|
||||
"lsl x2, x0, 3\n" /* envp (x2) = 8*argc ... */
|
||||
|
Reference in New Issue
Block a user