From owner-p4-projects@FreeBSD.ORG Fri May 23 18:11:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F16C537B404; Fri, 23 May 2003 18:11:55 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A884737B401 for ; Fri, 23 May 2003 18:11:55 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3773943F75 for ; Fri, 23 May 2003 18:11:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h4O1Bt0U007872 for ; Fri, 23 May 2003 18:11:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h4O1BsAA007869 for perforce@freebsd.org; Fri, 23 May 2003 18:11:54 -0700 (PDT) Date: Fri, 23 May 2003 18:11:54 -0700 (PDT) Message-Id: <200305240111.h4O1BsAA007869@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 31748 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2003 01:11:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=31748 Change 31748 by peter@peter_hammer on 2003/05/23 18:11:46 Take a shot at _rtld_bind_start Affected files ... .. //depot/projects/hammer/libexec/rtld-elf/amd64/rtld_start.S#8 edit Differences ... ==== //depot/projects/hammer/libexec/rtld-elf/amd64/rtld_start.S#8 (text+ko) ==== @@ -60,26 +60,52 @@ * We are careful to preserve all registers, even the the caller-save * registers. That is because this code may be invoked by low-level * assembly-language code that is not ABI-compliant. + * + * Stack map: + * obj 0x58 + * reloff 0x50 + * return addr 0x48 + * rflags 0x40 + * rax 0x38 + * rdx 0x30 + * rcx 0x28 + * rdi 0x20 + * r8 0x18 + * r9 0x10 + * r10 0x8 + * r11 0x0 */ .align 4 .globl _rtld_bind_start .type _rtld_bind_start,@function _rtld_bind_start: - pushfq # Save eflags + pushfq # Save rflags pushq %rax # Save %rax pushq %rdx # Save %rdx pushq %rcx # Save %rcx - pushq 20(%rsp) # Copy reloff argument - pushq 20(%rsp) # Copy obj argument + pushq %rsi # Save %rsi + pushq %rdi # Save %rdi + pushq %r8 # Save %r8 + pushq %r9 # Save %r9 + pushq %r10 # Save %r10 + pushq %r11 # Save %r11 + + movq 0x58(%rsp),%rdi # Fetch obj argument + movq 0x50(%rsp),%rsi # Fetch reloff argument call _rtld_bind@PLT # Transfer control to the binder /* Now %rax contains the entry point of the function being called. */ - addq $16,%rsp # Discard binder arguments - movq %rax,20(%rsp) # Store target over obj argument + movq %rax,0x58(%rsp) # Store target over obj argument + popq %r11 # Restore %r11 + popq %r10 # Restore %r10 + popq %r9 # Restore %r9 + popq %r8 # Restore %r8 + popq %rdi # Restore %rdi + popq %rsi # Restore %rsi popq %rcx # Restore %rcx popq %rdx # Restore %rdx popq %rax # Restore %rax - popfq # Restore eflags - leaq 8(%rsp),%rsp # Discard reloff, do not change eflags + popfq # Restore rflags + leaq 8(%rsp),%rsp # Discard reloff, do not change rflags ret # "Return" to target address