From owner-freebsd-arch@FreeBSD.ORG Tue Dec 16 23:19:25 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4E891065675; Tue, 16 Dec 2008 23:19:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 77C698FC12; Tue, 16 Dec 2008 23:19:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mBGNGXaI066247; Tue, 16 Dec 2008 16:16:33 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 16 Dec 2008 16:16:38 -0700 (MST) Message-Id: <20081216.161638.644659879.imp@bsdimp.com> To: rdivacky@freebsd.org From: "M. Warner Losh" In-Reply-To: <20081216212746.GA28834@freebsd.org> References: <20081216.131845.-1739986974.imp@bsdimp.com> <20081216212746.GA28834@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org Subject: Re: Removing some cruft... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 23:19:26 -0000 In message: <20081216212746.GA28834@freebsd.org> Roman Divacky writes: : On Tue, Dec 16, 2008 at 01:18:45PM -0700, M. Warner Losh wrote: : > I was looking at the MIPS elf stuff based on a submission of some : > 64-bit support. In doing so, I discovered a number of 'unused' types : > that appear to have comments that indicate that they can be removed : > now and were just slavishly copied from arch to arch to arch. : > : > /* : > * The following non-standard values are used for passing information : > * from John Polstra's testbed program to the dynamic linker. These : > * are expected to go away soon. : > * : > * Unfortunately, these overlap the Linux non-standard values, so they : > * must not be used in the same context. : > */ : > #define AT_BRK 10 /* Starting point for sbrk and brk. */ : > #define AT_DEBUG 11 /* Debugging level. */ : > : > These have be slavishly copied to arm, powerpc, sparc64, ia64, mips, : > sun4v and amd64. All these files have nearly identical comments : > (except powerpc, which changes the value). : > : > The only place these are used in the kernel is in the Linux! : > emulation in i386/linux/linux_sysvec.c and : > amd64/linux32/linux32_sysvec.c: : > : > if (args->trace) : > AUXARGS_ENTRY(pos, AT_DEBUG, 1); : > : > Since AT_DEBUG and AT_UID have the same value, and we look at AT_UID : > later, we wind up passing the wrong value for AT_UID. Fortunately, we : > don't use AT_UID for anything in the tree.... : : I cannot find any reference of AT_DEBUG in linux 2.6.16 sources and it : indeed looks bogus... What do you think of the following patch? Warner Index: sys/amd64/linux32/linux32_sysvec.c =================================================================== --- sys/amd64/linux32/linux32_sysvec.c (revision 186097) +++ sys/amd64/linux32/linux32_sysvec.c (working copy) @@ -254,8 +254,6 @@ args = (Elf32_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); - if (args->trace) - AUXARGS_ENTRY_32(pos, AT_DEBUG, 1); if (args->execfd != -1) AUXARGS_ENTRY_32(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY_32(pos, AT_PHDR, args->phdr); Index: sys/i386/linux/linux_sysvec.c =================================================================== --- sys/i386/linux/linux_sysvec.c (revision 186097) +++ sys/i386/linux/linux_sysvec.c (working copy) @@ -245,8 +245,6 @@ args = (Elf32_Auxargs *)imgp->auxargs; pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2); - if (args->trace) - AUXARGS_ENTRY(pos, AT_DEBUG, 1); if (args->execfd != -1) AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);