glibc/glibc-aarch64-workaround-nzcv-clobber-in-tlsdesc.patch
Siddhesh Poyarekar 9af85e62a6 Sync with upstream master
- glibc-bench-compare.patch: Merged upstream
- glibc-rh757881.patch: Fixed differently upstream
- glibc-revert-arena-threshold-fix.patch: Additional fixes on top of this
- glibc-rh841787.patch: Fixed differently upstream
- Set MODULE_NAME=librt for rtkaio
- Fix up glibc-rh741105.patch to continue to work with latest master
2015-07-28 10:38:07 +05:30

34 lines
1.0 KiB
Diff

diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
index ded5471..7d28496 100644
--- a/sysdeps/aarch64/dl-tlsdesc.S
+++ b/sysdeps/aarch64/dl-tlsdesc.S
@@ -140,7 +140,7 @@ _dl_tlsdesc_undefweak:
cfi_startproc
.align 2
_dl_tlsdesc_dynamic:
-# define NSAVEXREGPAIRS 2
+# define NSAVEXREGPAIRS 3
stp x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]!
cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
mov x29, sp
@@ -151,6 +151,10 @@ _dl_tlsdesc_dynamic:
stp x1, x2, [sp, #32+16*0]
stp x3, x4, [sp, #32+16*1]
+ /* Work around GCC rescheduling compares across tlsdesc calls. */
+ mrs x30, nzcv
+ stp xzr, x30, [sp, #32+16*2]
+
mrs x4, tpidr_el0
/* The ldar here happens after the load from [x0] at the call site
(that is generated by the compiler as part of the TLS access ABI),
@@ -169,6 +173,8 @@ _dl_tlsdesc_dynamic:
1:
ldp x1, x2, [sp, #32+16*0]
ldp x3, x4, [sp, #32+16*1]
+ ldp xzr, x30, [sp, #32+16*2]
+ msr nzcv, x30
ldp x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)