]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Save/restore bounds in x86_64 and x86_32 version of _dl_runtime_resolve.
authorLiubov Dmitrieva <liubov.dmitrieva@intel.com>
Wed, 10 Oct 2012 15:28:57 +0000 (19:28 +0400)
committerLiubov Dmitrieva <ldmitrie@sourceware.org>
Wed, 23 Oct 2013 14:14:58 +0000 (18:14 +0400)
sysdeps/i386/dl-trampoline.S
sysdeps/x86_64/dl-trampoline.S

index 945708fa735b6c4c5a0d653801ce046a5e275e83..dccdd71e160bc3ef9b17f280e651412f78578881 100644 (file)
@@ -31,9 +31,29 @@ _dl_runtime_resolve:
        cfi_adjust_cfa_offset (4)
        pushl %edx
        cfi_adjust_cfa_offset (4)
+#if !defined  __CHKP__ && !defined __CHKWR__
        movl 16(%esp), %edx     # Copy args pushed by PLT in register.  Note
        movl 12(%esp), %eax     # that `fixup' takes its parameters in regs.
+#else
+       subl $32, %esp
+       cfi_adjust_cfa_offset (32)
+       bndmov %bnd0, (%esp)
+       bndmov %bnd1, 8(%esp)
+       bndmov %bnd2, 16(%esp)
+       bndmov %bnd3, 24(%esp)
+       movl 48(%esp), %edx     # Copy args pushed by PLT in register.  Note
+       movl 44(%esp), %eax     # that `fixup' takes its parameters in regs.
+       bndldx 44(%esp, %eax), %bnd0
+#endif
        call _dl_fixup          # Call resolver.
+#if defined  __CHKP__ || defined __CHKWR__
+       bndmov 24(%esp), %bnd3
+       bndmov 16(%esp), %bnd2
+       bndmov 8(%esp), %bnd1
+       bndmov (%esp), %bnd0
+       addl $32, %esp
+       cfi_adjust_cfa_offset (-32)
+#endif
        popl %edx               # Get register content back.
        cfi_adjust_cfa_offset (-4)
        movl (%esp), %ecx
index a25e390a72804af6c7f1e725ce8b42c7cc2749e5..9ec6adeb9829d3d7e669cc6f9aaa4460212228c5 100644 (file)
        cfi_startproc
 _dl_runtime_resolve:
        cfi_adjust_cfa_offset(16) # Incorporate PLT
+#if !defined  __CHKP__ && !defined __CHKWR__
        subq $56,%rsp
        cfi_adjust_cfa_offset(56)
+#else
+       subq $120,%rsp
+       cfi_adjust_cfa_offset(120)
+#endif
        movq %rax,(%rsp)        # Preserve registers otherwise clobbered.
        movq %rcx, 8(%rsp)
        movq %rdx, 16(%rsp)
@@ -40,10 +45,26 @@ _dl_runtime_resolve:
        movq %rdi, 32(%rsp)
        movq %r8, 40(%rsp)
        movq %r9, 48(%rsp)
+#if !defined  __CHKP__ && !defined __CHKWR__
        movq 64(%rsp), %rsi     # Copy args pushed by PLT in register.
        movq 56(%rsp), %rdi     # %rdi: link_map, %rsi: reloc_index
+#else
+       bndmov %bnd0, 56(%rsp)
+       bndmov %bnd1, 72(%rsp)
+       bndmov %bnd2, 88(%rsp)
+       bndmov %bnd3, 104(%rsp)
+       movq 128(%rsp), %rsi    # Copy args pushed by PLT in register.
+       movq 120(%rsp), %rdi    # %rdi: link_map, %rsi: reloc_index
+       bndldx 120(%rsp, %rdi), %bnd0
+#endif
        call _dl_fixup          # Call resolver.
        movq %rax, %r11         # Save return value
+#if defined  __CHKP__ || defined __CHKWR__
+       bndmov 104(%rsp), %bnd3
+       bndmov 88(%rsp), %bnd2
+       bndmov 72(%rsp), %bnd1
+       bndmov 56(%rsp), %bnd0
+#endif
        movq 48(%rsp), %r9      # Get register content back.
        movq 40(%rsp), %r8
        movq 32(%rsp), %rdi
@@ -51,8 +72,13 @@ _dl_runtime_resolve:
        movq 16(%rsp), %rdx
        movq 8(%rsp), %rcx
        movq (%rsp), %rax
+#if !defined  __CHKP__ && !defined __CHKWR__
        addq $72, %rsp          # Adjust stack(PLT did 2 pushes)
        cfi_adjust_cfa_offset(-72)
+#else
+       addq $136, %rsp         # Adjust stack(PLT did 2 pushes)
+       cfi_adjust_cfa_offset(-136)
+#endif
        jmp *%r11               # Jump to function address.
        cfi_endproc
        .size _dl_runtime_resolve, .-_dl_runtime_resolve