From owner-svn-src-head@freebsd.org Sat Jul 23 03:28:07 2016 Return-Path: Delivered-To: svn-src-head@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 F3B68BA263E; Sat, 23 Jul 2016 03:28:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id BAE8D16AC; Sat, 23 Jul 2016 03:28:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-149.carlnfd1.nsw.optusnet.com.au [110.21.100.149]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id EC56078139C; Sat, 23 Jul 2016 13:28:01 +1000 (AEST) Date: Sat, 23 Jul 2016 13:28:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303209 - head/sys/powerpc/booke In-Reply-To: <201607230227.u6N2Rgiw002223@repo.freebsd.org> Message-ID: <20160723130540.Q2164@besplex.bde.org> References: <201607230227.u6N2Rgiw002223@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=XDAe9YG+7EcdVXYrgT+/UQ==:117 a=XDAe9YG+7EcdVXYrgT+/UQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=HFGmMxYJA0FTgHnMFwcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2016 03:28:07 -0000 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. > 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. 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