about summary refs log tree commit diff
path: root/sysdeps/s390/s390-64/dl-trampoline.h
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
commit5755f5e4ccc97f6a502d4a176ccec87a98f1c866 (patch)
tree5aa2ed66b269881fb31bf30c4643f1acb4373ea8 /sysdeps/s390/s390-64/dl-trampoline.h
parentc8ad85225bd5968e45c716519d88743811dbdb3e (diff)
downloadglibc-5755f5e4ccc97f6a502d4a176ccec87a98f1c866.tar.gz
glibc-5755f5e4ccc97f6a502d4a176ccec87a98f1c866.tar.xz
glibc-5755f5e4ccc97f6a502d4a176ccec87a98f1c866.zip
S390: Do not clobber R0 in 64-bit _dl_runtime_resolve
Preparation for the usage of R0 by __fentry__.

ChangeLog:

	* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_resolve):
	Do not clobber R0.
Diffstat (limited to 'sysdeps/s390/s390-64/dl-trampoline.h')
-rw-r--r--sysdeps/s390/s390-64/dl-trampoline.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h
index e05974322c..a9d56a6925 100644
--- a/sysdeps/s390/s390-64/dl-trampoline.h
+++ b/sysdeps/s390/s390-64/dl-trampoline.h
@@ -23,8 +23,9 @@
  *   v24, v26, v28, v30, v25, v27, v29, v31 : vector parameter registers
  *   48(r15), 56(r15) : PLT arguments PLT1, PLT2
  *   160(r15) : additional stack parameters
- * The normal clobber rules for function calls apply:
- *   r0 - r5 : call clobbered
+ * The slightly tightened normal clobber rules for function calls apply:
+ *   r0 : call saved (for __fentry__)
+ *   r1 - r5 : call clobbered
  *   r6 - r13 :	 call saved
  *   r14 : return address (call clobbered)
  *   r15 : stack pointer (call saved)
@@ -47,6 +48,7 @@
 #define V29_OFF -208
 #define V30_OFF -192
 #define V31_OFF -176
+#define R0_OFF -120
 #define PLT1_OFF -112
 #define PLT2_OFF -104
 #define R2_OFF -96
@@ -64,6 +66,8 @@
 	cfi_startproc
 	.align 16
 _dl_runtime_resolve:
+	stg    %r0,CFA_OFF+R0_OFF(%r15)
+	cfi_offset (r0, R0_OFF)
 	stmg   %r2,%r5,CFA_OFF+R2_OFF(%r15) # save registers
 	cfi_offset (r2, R2_OFF)
 	cfi_offset (r3, R3_OFF)
@@ -120,6 +124,7 @@ _dl_runtime_resolve:
 	ld     %f4,CFA_OFF+F4_OFF(%r15)
 	ld     %f6,CFA_OFF+F6_OFF(%r15)
 	lmg    %r2,%r5,CFA_OFF+R2_OFF(%r15)
+	lg     %r0,CFA_OFF+R0_OFF(%r15)
 	br     %r1
 	cfi_endproc
 	.size _dl_runtime_resolve, .-_dl_runtime_resolve
@@ -131,6 +136,7 @@ _dl_runtime_resolve:
 #undef V29_OFF
 #undef V30_OFF
 #undef V31_OFF
+#undef R0_OFF
 #undef PLT1_OFF
 #undef PLT2_OFF
 #undef R2_OFF