summary refs log tree commit diff
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2018-08-10 09:07:43 +0200
committerStefan Liebler <stli@linux.ibm.com>2018-08-10 09:07:43 +0200
commitbde6320f39cfe56fe3cbafe55fc498d7b329ff05 (patch)
tree0b516cf3a1674833450b6170c73d3108a7dae0d7
parent5755f5e4ccc97f6a502d4a176ccec87a98f1c866 (diff)
downloadglibc-bde6320f39cfe56fe3cbafe55fc498d7b329ff05.tar.gz
glibc-bde6320f39cfe56fe3cbafe55fc498d7b329ff05.tar.xz
glibc-bde6320f39cfe56fe3cbafe55fc498d7b329ff05.zip
S390: Do not clobber R0 in 64-bit _dl_runtime_profile
Preparation for the usage of R0 by __fentry__.

ChangeLog:

	* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile):
	Do not clobber R0.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/s390/s390-64/dl-trampoline.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fb04742ba7..87e3288712 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2018-08-10  Ilya Leoshkevich  <iii@linux.ibm.com>
 
+	* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile):
+	Do not clobber R0.
+
+2018-08-10  Ilya Leoshkevich  <iii@linux.ibm.com>
+
 	* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_resolve):
 	Do not clobber R0.
 
diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h
index a9d56a6925..fc5ba23563 100644
--- a/sysdeps/s390/s390-64/dl-trampoline.h
+++ b/sysdeps/s390/s390-64/dl-trampoline.h
@@ -170,6 +170,7 @@ _dl_runtime_resolve:
 # define V29_OFF -208
 # define V30_OFF -192
 # define V31_OFF -176
+# define R0_OFF -144
 # define R12_OFF -136
 # define R14_OFF -128
 # define FRAMESIZE_OFF -120
@@ -185,6 +186,8 @@ _dl_runtime_resolve:
 	cfi_startproc
 	.align 16
 _dl_runtime_profile:
+	stg     %r0,CFA_OFF+R0_OFF(%r15)
+	cfi_offset (r0, R0_OFF)
 	stg    %r12,CFA_OFF+R12_OFF(%r15)	# r12 is used as backup of r15
 	cfi_offset (r12, R12_OFF)
 	stg    %r14,CFA_OFF+R14_OFF(%r15)
@@ -250,6 +253,7 @@ _dl_runtime_profile:
 	cfi_def_cfa_register (15)
 	lg     %r14,CFA_OFF+R14_OFF(%r15)	# restore registers
 	lg     %r12,CFA_OFF+R12_OFF(%r15)
+	lg     %r0,CFA_OFF+R0_OFF(%r15)
 	br     %r1				# tail call
 
 	cfi_def_cfa_register (12)
@@ -287,6 +291,7 @@ _dl_runtime_profile:
 	cfi_def_cfa_register (15)
 	lg     %r14,CFA_OFF+R14_OFF(%r15)	# restore registers
 	lg     %r12,CFA_OFF+R12_OFF(%r15)
+	lg     %r0,CFA_OFF+R0_OFF(%r15)
 	lg     %r2,CFA_OFF+RET_R2_OFF(%r15)	# restore return values
 	ld     %f0,CFA_OFF+RET_F0_OFF(%r15)
 # ifdef RESTORE_VRS
@@ -318,6 +323,7 @@ _dl_runtime_profile:
 # undef V29_OFF
 # undef V30_OFF
 # undef V31_OFF
+# undef R0_OFF
 # undef R12_OFF
 # undef R14_OFF
 # undef FRAMESIZE_OFF