Skip to content

Commit 12a76ad

Browse files
authored
fix(bthread/context): Add .previous after GNU-stack note (#3266)
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
1 parent 1246602 commit 12a76ad

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/bthread/context.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ __asm (
576576
".size bthread_jump_fcontext,.-bthread_jump_fcontext\n"
577577
"@ Mark that we don't need executable stack.\n"
578578
".section .note.GNU-stack,\"\",%progbits\n"
579+
".previous\n"
579580
);
580581

581582
#endif
@@ -607,6 +608,7 @@ __asm (
607608
".size bthread_make_fcontext,.-bthread_make_fcontext\n"
608609
"@ Mark that we don't need executable stack.\n"
609610
".section .note.GNU-stack,\"\",%progbits\n"
611+
".previous\n"
610612
);
611613

612614
#endif
@@ -678,6 +680,7 @@ __asm (
678680
".size bthread_jump_fcontext,.-bthread_jump_fcontext\n"
679681
"# Mark that we don't need executable stack.\n"
680682
".section .note.GNU-stack,\"\",%progbits\n"
683+
".previous\n"
681684
);
682685

683686
#endif
@@ -710,6 +713,7 @@ __asm (
710713
".size bthread_make_fcontext,.-bthread_make_fcontext\n"
711714
"# Mark that we don't need executable stack.\n"
712715
".section .note.GNU-stack,\"\",%progbits\n"
716+
".previous\n"
713717
);
714718

715719
#endif

0 commit comments

Comments
 (0)