Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2017 22:18:01 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323466 - head/libexec/rtld-elf/mips
Message-ID:  <201709112218.v8BMI15x061421@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Sep 11 22:18:01 2017
New Revision: 323466
URL: https://svnweb.freebsd.org/changeset/base/323466

Log:
  Add CFI directives for _rtld_bind_start.
  
  This allows debuggers to unwind back into the caller when stopped in the
  runtime linker.
  
  Sponsored by:	DARPA / AFRL

Modified:
  head/libexec/rtld-elf/mips/rtld_start.S

Modified: head/libexec/rtld-elf/mips/rtld_start.S
==============================================================================
--- head/libexec/rtld-elf/mips/rtld_start.S	Mon Sep 11 21:49:38 2017	(r323465)
+++ head/libexec/rtld-elf/mips/rtld_start.S	Mon Sep 11 22:18:01 2017	(r323466)
@@ -104,26 +104,39 @@ END(rtld_start)
 	.ent	_rtld_bind_start
 _rtld_bind_start:
 	.frame	sp, XCALLFRAME_SIZ, $15
+	.cfi_startproc simple
+	.cfi_register ra, $15
 	move	v1, gp			/* save old GP */
 #if defined(__mips_o32) || defined(__mips_o64)
 	PTR_ADDU t9, 8			/* modify T9 to point at .cpload */
 #endif
 	SETUP_GP
 	PTR_SUBU sp, XCALLFRAME_SIZ	/* save arguments and sp value in stack */
+	.cfi_def_cfa sp, XCALLFRAME_SIZ
 	SETUP_GP64(XCALLFRAME_GP, _rtld_bind_start)
 	SAVE_GP(XCALLFRAME_GP)
 #if defined(__mips_n32) || defined(__mips_n64)
 	REG_S	a4,  XCALLFRAME_A4(sp)
+	.cfi_rel_offset a4, XCALLFRAME_A4
 	REG_S	a5,  XCALLFRAME_A5(sp)
+	.cfi_rel_offset a5, XCALLFRAME_A5
 	REG_S	a6,  XCALLFRAME_A6(sp)
+	.cfi_rel_offset a6, XCALLFRAME_A6
 	REG_S	a7,  XCALLFRAME_A7(sp)
+	.cfi_rel_offset a7, XCALLFRAME_A7
 #endif
 	REG_S	a0,  XCALLFRAME_A0(sp)
+	.cfi_rel_offset a0, XCALLFRAME_A0
 	REG_S	a1,  XCALLFRAME_A1(sp)
+	.cfi_rel_offset a1, XCALLFRAME_A1
 	REG_S	a2,  XCALLFRAME_A2(sp)
+	.cfi_rel_offset a2, XCALLFRAME_A2
 	REG_S	a3,  XCALLFRAME_A3(sp)
+	.cfi_rel_offset a3, XCALLFRAME_A3
 	REG_S	$15,  XCALLFRAME_RA(sp)	/* ra is in t7/t3 */
+	.cfi_rel_offset ra, XCALLFRAME_RA
 	REG_S	s0,  XCALLFRAME_S0(sp)
+	.cfi_rel_offset s0, XCALLFRAME_S0
 	move	s0, sp
 
 	move	a0, v1			/* old GP */
@@ -147,20 +160,31 @@ _rtld_bind_start:
 
 	move	sp, s0
 	REG_L	ra, XCALLFRAME_RA(sp)
+	.cfi_restore ra
 	REG_L	s0, XCALLFRAME_S0(sp)
+	.cfi_restore s0
 	REG_L	a0, XCALLFRAME_A0(sp)
+	.cfi_restore a0
 	REG_L	a1, XCALLFRAME_A1(sp)
+	.cfi_restore a1
 	REG_L	a2, XCALLFRAME_A2(sp)
+	.cfi_restore a2
 	REG_L	a3, XCALLFRAME_A3(sp)
+	.cfi_restore a3
 #if defined(__mips_n32) || defined(__mips_n64)
 	REG_L	a4, XCALLFRAME_A4(sp)
+	.cfi_restore a4
 	REG_L	a5, XCALLFRAME_A5(sp)
+	.cfi_restore a5
 	REG_L	a6, XCALLFRAME_A6(sp)
+	.cfi_restore a6
 	REG_L	a7, XCALLFRAME_A7(sp)
+	.cfi_restore a7
 #endif
 	RESTORE_GP64
 	PTR_ADDU sp, XCALLFRAME_SIZ
 	move	t9, v0
 	jr	t9
 	nop
+	.cfi_endproc
 END(_rtld_bind_start)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709112218.v8BMI15x061421>