aarch64: Add unwind information to _start (bug 26853)

Message ID 87ft5issb2.fsf@oldenburg2.str.redhat.com
State Committed
Headers
Series aarch64: Add unwind information to _start (bug 26853) |

Commit Message

Florian Weimer Nov. 9, 2020, 11:06 a.m. UTC
  This adds CFI directives which communicate that the stack ends
with this function.

Fixes bug 26853.

---
 sysdeps/aarch64/start.S | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Comments

Siddhesh Poyarekar Nov. 9, 2020, 11:18 a.m. UTC | #1
On 11/9/20 4:36 PM, Florian Weimer via Libc-alpha wrote:
> This adds CFI directives which communicate that the stack ends
> with this function.
> 
> Fixes bug 26853.

This is fine.

Thanks,
Siddhesh
  
Szabolcs Nagy Nov. 9, 2020, 11:58 a.m. UTC | #2
The 11/09/2020 12:06, Florian Weimer via Libc-alpha wrote:
> This adds CFI directives which communicate that the stack ends
> with this function.
> 
> Fixes bug 26853.

this looks good.
thanks.


> 
> ---
>  sysdeps/aarch64/start.S | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
> index 75393e1c18..108f602721 100644
> --- a/sysdeps/aarch64/start.S
> +++ b/sysdeps/aarch64/start.S
> @@ -43,11 +43,9 @@
>   */
>  
>  	.text
> -	.globl _start
> -	.type _start,#function
> -_start:
> -	BTI_C
> +ENTRY(_start)
>  	/* Create an initial frame with 0 LR and FP */
> +	cfi_undefined (x30)
>  	mov	x29, #0
>  	mov	x30, #0
>  
> @@ -103,6 +101,7 @@ _start:
>  __wrap_main:
>  	b	main
>  #endif
> +END(_start)
>  
>  	/* Define a symbol for the first piece of initialized data.  */
>  	.data
> 
> -- 
> Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
> Commercial register: Amtsgericht Muenchen, HRB 153243,
> Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
>
  

Patch

diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
index 75393e1c18..108f602721 100644
--- a/sysdeps/aarch64/start.S
+++ b/sysdeps/aarch64/start.S
@@ -43,11 +43,9 @@ 
  */
 
 	.text
-	.globl _start
-	.type _start,#function
-_start:
-	BTI_C
+ENTRY(_start)
 	/* Create an initial frame with 0 LR and FP */
+	cfi_undefined (x30)
 	mov	x29, #0
 	mov	x30, #0
 
@@ -103,6 +101,7 @@  _start:
 __wrap_main:
 	b	main
 #endif
+END(_start)
 
 	/* Define a symbol for the first piece of initialized data.  */
 	.data