From owner-svn-src-all@freebsd.org Sun Jul 24 00:06:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC28DBA2CF7; Sun, 24 Jul 2016 00:06:47 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B43C1368; Sun, 24 Jul 2016 00:06:47 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-yw0-x233.google.com with SMTP id u134so132750599ywg.3; Sat, 23 Jul 2016 17:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=s+puyyN9GrDzFbiibvcHy6EoQCE8tlgLDb/cNvW+CRk=; b=XqJNCtJcIfry5pnimg1saeuBn9ZB/nxPpJx97XunLhY09krKAirX6AQ9q/5/Syq8zb u5UXeFO4jS5hiosXJY7FkGMiHwmx989SGECM8JKD/utZpjhmYPfpVygOPIbTC2oeaaUa B4VyuiXxSdy8XB/P2/tLaWTNk74jxdaASyZ6L04ZM7hXsC9afiuSpEt1UxpeB6HnmWw5 N1EJ+Hzvqed15Clqf6NaMeC2nCl+HLjWsydqU/LDVQMx6STO7FxSceeLfYMCIjn4NNq4 +bgxfbY/Bx4U9o/Rgtaq6CU3Uwt/6fSPRLgGNnSoy9afCj0AancO96bo34GxCDGaJ7Ss ZZzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=s+puyyN9GrDzFbiibvcHy6EoQCE8tlgLDb/cNvW+CRk=; b=gokbim1el2pnhoSZXBRdkmB347/wz+MZJxJvIny+fo1Fr2GcjIVobPji/GTnP8vrH1 ROX5vEatsIi+ahK8CSB7R3zjVXcBfgYv5hANxEQ8cg0vxZkdWI7lxd3W0DUL+Kye33rb 7YDY8lU/cKZ+eZupo+ui3C46VhhrycgQKvSOZB4BsiSmMaW1rWzvVttMO/zV+g7Bfifq 5LJhLsh3eKeTXVeqBkITcLzaTT50EHy6XLG2gPblt0nBeuT9Bl/iAyQHJWVpIpIQf3Ue ySqCK0GLk0RoN1e2MqD8WPj/KhAqIiiJIHPoeYHWq6Cbyor0xm7SEHXu9uCBH9AQBnOk zdmg== X-Gm-Message-State: AEkoouulA4a5oR08Z0lIjW6eIZfS8P2YwXEWNi2n7b+PX5aMcmC2sKJgdhL/GT5zBdrWLw== X-Received: by 10.37.0.198 with SMTP id 189mr9152623yba.119.1469318806241; Sat, 23 Jul 2016 17:06:46 -0700 (PDT) Received: from [172.20.1.77] (rrcs-71-43-12-11.se.biz.rr.com. [71.43.12.11]) by smtp.gmail.com with ESMTPSA id x126sm8428847ywg.12.2016.07.23.17.06.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Jul 2016 17:06:45 -0700 (PDT) Sender: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <114ED1ED-C709-4C80-B9A3-A0609445AB5E@freebsd.org> From: Justin Hibbits To: Bruce Evans In-Reply-To: <20160723130540.Q2164@besplex.bde.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r303209 - head/sys/powerpc/booke Date: Sat, 23 Jul 2016 20:06:28 -0500 References: <201607230227.u6N2Rgiw002223@repo.freebsd.org> <20160723130540.Q2164@besplex.bde.org> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 00:06:47 -0000 On Jul 22, 2016, at 10:28 PM, Bruce Evans wrote: > On Sat, 23 Jul 2016, Justin Hibbits wrote: > >> Log: >> Use label math instead of hard-coding offsets for return addresses. >> >> Though the chances of the code in these sections changing are low, >> future-proof >> the sections and use label math. > > Not with numeric labels. I'm not future proofing it against label changes, I'm future proofing it against instruction additions/subtractions. > >> Renumber the surrounding areas to avoid duplicate label numbers. > > New numeric labels tend to move the addresses of old labels. > Renumbering > to give unique numeric labels more than defeats their reason for > existence -- > you have to manage them on every change to a label anywhere in the > file > (and perhaps in macros and included files). You never get a error for > a duplicated numeric label. Non-unique numeric labels are also a good > obfuscation. Given a branch to 1f or 1b, grepping the file for 1: may > find many labels 1:. You have to examine all the labels named 1: or > search only near the jump to see where 1 is. Its name is supposed to > not matter, but perhaps it does. I debated renumbering, and in my first iteration I didn't, but decided to for final commit, just for pure aesthetic purposes. In the future, I expect a lot of 0: labels for number labels, but as you mention below, named labels should be used for most labels anyway. > > Numeric labels should only be used in macros, and then only when the > macro processor is too feeble to support generating unique non-numeric > labels. Standard cpp is too feeble for this. > > I managed to remove all numeric labels in i386/exception.s (except in > macros and included files), and none came back. amd64/exception.S has > 19 of them, 7 with the additional style bug of being on a line with > a statement or comment. > > Bruce - Justin