r5022 - in glibc-package/trunk/debian: . patches patches/amd64
Author: aurel32
Date: 2011-10-30 17:11:54 +0000 (Sun, 30 Oct 2011)
New Revision: 5022
Added:
glibc-package/trunk/debian/patches/amd64/cvs-dl_trampoline-cfi.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
* patches/amd64/cvs-dl_trampoline-cfi.diff: fix CFI in dl_trampoline code.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2011-10-30 17:05:36 UTC (rev 5021)
+++ glibc-package/trunk/debian/changelog 2011-10-30 17:11:54 UTC (rev 5022)
@@ -14,6 +14,7 @@
#644771.
* patches/amd64/cvs-avx-detection.diff: do not use AVX if hardware support
is present, but not enabled in the kernel. Closes: #646549.
+ * patches/amd64/cvs-dl_trampoline-cfi.diff: fix CFI in dl_trampoline code.
[ Samuel Thibault ]
* patches/hurd-i386/submitted-setresid.diff: New patch to fix -1 passed to
Added: glibc-package/trunk/debian/patches/amd64/cvs-dl_trampoline-cfi.diff
===================================================================
--- glibc-package/trunk/debian/patches/amd64/cvs-dl_trampoline-cfi.diff (rev 0)
+++ glibc-package/trunk/debian/patches/amd64/cvs-dl_trampoline-cfi.diff 2011-10-30 17:11:54 UTC (rev 5022)
@@ -0,0 +1,129 @@
+2011-08-20 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Fix CFI for
+ the very first instruction.
+ * sysdeps/x86_64/dl-trampoline.h: If MORE_CODE is defined, restore
+ the CFI state in the end.
+ * sysdeps/x86_64/dl-trampoline.S: Define MORE_CODE before first
+ inclusion of dl-trampoline.h.
+ Based on a patch by Jiri Olsa <jolsa@redhat.com>.
+
+---
+ sysdeps/x86_64/dl-trampoline.S | 8 +++++---
+ sysdeps/x86_64/dl-trampoline.h | 25 ++++++++++++++++---------
+ 2 files changed, 21 insertions(+), 12 deletions(-)
+
+--- a/sysdeps/x86_64/dl-trampoline.S
++++ b/sysdeps/x86_64/dl-trampoline.S
+@@ -27,8 +27,9 @@
+ .align 16
+ cfi_startproc
+ _dl_runtime_resolve:
++ cfi_adjust_cfa_offset(16) # Incorporate PLT
+ subq $56,%rsp
+- cfi_adjust_cfa_offset(72) # Incorporate PLT
++ cfi_adjust_cfa_offset(56)
+ movq %rax,(%rsp) # Preserve registers otherwise clobbered.
+ movq %rcx, 8(%rsp)
+ movq %rdx, 16(%rsp)
+@@ -158,14 +159,15 @@
+ 1: js L(no_avx)
+
+ # define RESTORE_AVX
++# define MORE_CODE
+ # include "dl-trampoline.h"
+
+ .align 16
+ L(no_avx):
+ # endif
+
+-# undef RESTORE_AVX
+-# include "dl-trampoline.h"
++# undef RESTORE_AVX
++# include "dl-trampoline.h"
+
+ cfi_endproc
+ .size _dl_runtime_profile, .-_dl_runtime_profile
+--- a/sysdeps/x86_64/dl-trampoline.h
++++ b/sysdeps/x86_64/dl-trampoline.h
+@@ -1,6 +1,6 @@
+ /* Partial PLT profile trampoline to save and restore x86-64 vector
+ registers.
+- Copyright (C) 2009 Free Software Foundation, Inc.
++ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+@@ -195,14 +195,14 @@
+ _dl_call_pltexit. The La_x86_64_regs is being pointed by rsp now,
+ so we just need to allocate the sizeof(La_x86_64_retval) space on
+ the stack, since the alignment has already been taken care of. */
+-# ifdef RESTORE_AVX
++#ifdef RESTORE_AVX
+ /* sizeof(La_x86_64_retval). Need extra space for 2 SSE
+ registers to detect if xmm0/xmm1 registers are changed
+ by audit module. */
+ subq $(LRV_SIZE + XMM_SIZE*2), %rsp
+-# else
++#else
+ subq $LRV_SIZE, %rsp # sizeof(La_x86_64_retval)
+-# endif
++#endif
+ movq %rsp, %rcx # La_x86_64_retval argument to %rcx.
+
+ /* Fill in the La_x86_64_retval structure. */
+@@ -212,7 +212,7 @@
+ movaps %xmm0, LRV_XMM0_OFFSET(%rcx)
+ movaps %xmm1, LRV_XMM1_OFFSET(%rcx)
+
+-# ifdef RESTORE_AVX
++#ifdef RESTORE_AVX
+ /* This is to support AVX audit modules. */
+ vmovdqu %ymm0, LRV_VECTOR0_OFFSET(%rcx)
+ vmovdqu %ymm1, LRV_VECTOR1_OFFSET(%rcx)
+@@ -221,14 +221,14 @@
+ by audit module. */
+ vmovdqa %xmm0, (LRV_SIZE)(%rcx)
+ vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx)
+-# endif
++#endif
+
+ fstpt LRV_ST0_OFFSET(%rcx)
+ fstpt LRV_ST1_OFFSET(%rcx)
+
+ movq 24(%rbx), %rdx # La_x86_64_regs argument to %rdx.
+ movq 40(%rbx), %rsi # Copy args pushed by PLT in register.
+- movq 32(%rbx), %rdi # %rdi: link_map, %rsi: reloc_index
++ movq 32(%rbx), %rdi # %rdi: link_map, %rsi: reloc_index
+ call _dl_call_pltexit
+
+ /* Restore return registers. */
+@@ -238,7 +238,7 @@
+ movaps LRV_XMM0_OFFSET(%rsp), %xmm0
+ movaps LRV_XMM1_OFFSET(%rsp), %xmm1
+
+-# ifdef RESTORE_AVX
++#ifdef RESTORE_AVX
+ /* Check if xmm0/xmm1 registers are changed by audit module. */
+ vpcmpeqq (LRV_SIZE)(%rsp), %xmm0, %xmm2
+ vpmovmskb %xmm2, %esi
+@@ -253,7 +253,7 @@
+ vmovdqu LRV_VECTOR1_OFFSET(%rsp), %ymm1
+
+ 1:
+-# endif
++#endif
+
+ fldt LRV_ST1_OFFSET(%rsp)
+ fldt LRV_ST0_OFFSET(%rsp)
+@@ -267,3 +267,10 @@
+ # (eats the reloc index and link_map)
+ cfi_adjust_cfa_offset(-48)
+ retq
++
++#ifdef MORE_CODE
++ cfi_adjust_cfa_offset(48)
++ cfi_rel_offset(%rbx, 0)
++ cfi_def_cfa_register(%rbx)
++# undef MORE_CODE
++#endif
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2011-10-30 17:05:36 UTC (rev 5021)
+++ glibc-package/trunk/debian/patches/series 2011-10-30 17:11:54 UTC (rev 5022)
@@ -75,6 +75,7 @@
amd64/cvs-powl.diff
amd64/cvs-pthread-stack-alignment.diff
amd64/cvs-avx-detection.diff
+amd64/cvs-dl_trampoline-cfi.diff
arm/local-atomic.diff
arm/local-eabi-wchar.diff
Reply to: