From owner-freebsd-bugs Sat Dec 21 7:20: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A63E37B401 for ; Sat, 21 Dec 2002 07:20:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40C3343EE5 for ; Sat, 21 Dec 2002 07:20:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBLFK2NS033150 for ; Sat, 21 Dec 2002 07:20:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBLFK2Hu033149; Sat, 21 Dec 2002 07:20:02 -0800 (PST) Date: Sat, 21 Dec 2002 07:20:02 -0800 (PST) Message-Id: <200212211520.gBLFK2Hu033149@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: David Malone Subject: Re: i386/46258: PLT code causes skewed return hint stack Reply-To: David Malone Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR i386/46258; it has been noted by GNATS. From: David Malone To: Torbjorn Granlund Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: i386/46258: PLT code causes skewed return hint stack Date: Sat, 21 Dec 2002 15:16:41 +0000 On Sat, Dec 14, 2002 at 05:29:33PM +0100, Torbjorn Granlund wrote: > If using a jmp is impossible, we could live with getting one > return hint stack miss, but we don't want the entire hint stack > to become skewed. Shouldn't the code look like the > following instead? I turned your suggestion into a patch, to make it clearer what it changes. Can you suggest some code to measure if this makes a measurable difference? David. diff -u -r1.3 rtld_start.S --- i386/rtld_start.S 28 Aug 1999 00:10:15 -0000 1.3 +++ i386/rtld_start.S 21 Dec 2002 15:11:06 -0000 @@ -77,8 +77,9 @@ call _rtld_bind@PLT # Transfer control to the binder /* Now %eax contains the entry point of the function being called. */ - - addl $8,%esp # Discard binder arguments + call 1f # Balance call stack for return hinting +1: + addl $12,%esp # Discard binder arguments movl %eax,20(%esp) # Store target over obj argument popl %ecx # Restore %ecx popl %edx # Restore %edx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message