From b6688c83736263ecbf70b9edb4a992f93b845ec2 Mon Sep 17 00:00:00 2001 From: condy Date: Fri, 10 Apr 2026 07:50:27 +0800 Subject: [PATCH] fix(bthread/context): Add .previous after GNU-stack note Add missing .previous directive after each .note.GNU-stack section in ARM inline assembly blocks. This ensures proper section switching and prevents potential assembler errors when building with asan. See #1186 --- src/bthread/context.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bthread/context.cpp b/src/bthread/context.cpp index b7be731eae..7f913adfc1 100644 --- a/src/bthread/context.cpp +++ b/src/bthread/context.cpp @@ -576,6 +576,7 @@ __asm ( ".size bthread_jump_fcontext,.-bthread_jump_fcontext\n" "@ Mark that we don't need executable stack.\n" ".section .note.GNU-stack,\"\",%progbits\n" +".previous\n" ); #endif @@ -607,6 +608,7 @@ __asm ( ".size bthread_make_fcontext,.-bthread_make_fcontext\n" "@ Mark that we don't need executable stack.\n" ".section .note.GNU-stack,\"\",%progbits\n" +".previous\n" ); #endif @@ -678,6 +680,7 @@ __asm ( ".size bthread_jump_fcontext,.-bthread_jump_fcontext\n" "# Mark that we don't need executable stack.\n" ".section .note.GNU-stack,\"\",%progbits\n" +".previous\n" ); #endif @@ -710,6 +713,7 @@ __asm ( ".size bthread_make_fcontext,.-bthread_make_fcontext\n" "# Mark that we don't need executable stack.\n" ".section .note.GNU-stack,\"\",%progbits\n" +".previous\n" ); #endif