djdelorie / rpms / glibc

Forked from rpms/glibc 3 years ago
Clone
371b5ec
commit a85abfa92220239cad0a8a6b0f2a223f5e6472a9
371b5ec
Author: Andreas Schwab <schwab@suse.de>
371b5ec
Date:   Thu Aug 18 11:38:28 2016 +0200
371b5ec
371b5ec
    arm: mark __startcontext as .cantunwind (bug 20435)
371b5ec
    
371b5ec
    __startcontext marks the bottom of the call stack of the contexts created
371b5ec
    by makecontext.
371b5ec
    
371b5ec
    (cherry picked from commit 9e2ff6c9cc54c0b4402b8d49e4abe7000fde7617)
371b5ec
    
371b5ec
    Also includes the NEWS update, cherry-picked from commits
371b5ec
    056dd72af83f5459ce6d545a49dea6dba7d635dc and
371b5ec
    4d047efdbc55b0d68947cde682e5363d16a66294.
371b5ec
371b5ec
diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S
371b5ec
index 24c7294..926b65a 100644
371b5ec
--- a/sysdeps/unix/sysv/linux/arm/setcontext.S
371b5ec
+++ b/sysdeps/unix/sysv/linux/arm/setcontext.S
371b5ec
@@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext)
371b5ec
 
371b5ec
 	/* Called when a makecontext() context returns.  Start the
371b5ec
 	   context in R4 or fall through to exit().  */
371b5ec
+	/* Unwind descriptors are looked up based on PC - 2, so we have to
371b5ec
+	   make sure to mark the instruction preceding the __startcontext
371b5ec
+	   label as .cantunwind.  */
371b5ec
+	.fnstart
371b5ec
+	.cantunwind
371b5ec
+	nop
371b5ec
 ENTRY(__startcontext)
371b5ec
 	movs    r0, r4
371b5ec
 	bne     PLTJMP(__setcontext)
371b5ec
 
371b5ec
 	@ New context was 0 - exit
371b5ec
 	b       PLTJMP(HIDDEN_JUMPTARGET(exit))
371b5ec
+	.fnend
371b5ec
 END(__startcontext)
371b5ec
 
371b5ec
 #ifdef PIC