Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Vnldk-0000f4-6w for mharc-grub-devel@gnu.org; Tue, 03 Dec 2013 03:47:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnldc-0000dY-MZ for grub-devel@gnu.org; Tue, 03 Dec 2013 03:47:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnldW-0006U6-N4 for grub-devel@gnu.org; Tue, 03 Dec 2013 03:47:24 -0500 Received: from mail-we0-f170.google.com ([74.125.82.170]:45645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnldW-0006Tz-Gr for grub-devel@gnu.org; Tue, 03 Dec 2013 03:47:18 -0500 Received: by mail-we0-f170.google.com with SMTP id w61so13362698wes.1 for ; Tue, 03 Dec 2013 00:47:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=tkw9RV66ElN/M6170J+iLqRo0jUOhnNI4H/JDJxDVDc=; b=UoubYoAhPeifv+q33zvlpStFq1ErhFo97NLda9xb8NS3CvN+9eFh0nyHW4BtKXwY3O BUFn9oVlpgav3NWyOOJbgI5PYhqeEpSIxvPNajSEgX3BESwDedsM4Tawe2yrR6VIujlb M8t4WR0PIyaMwt2Tgs5PyJfxuTWBi2Kmr6o7Y0vnPpzQSDY1Xm07/cVSdhtCZy7ziRFl HpxDobHGvRnIFBjRTrGmynDiMgh9LidMd+lU1gja37LW3ZZelDvilEteWUi3C6kdT7Me nS4iVI1HIjQw0F+i15k5K7Q3qCSIfzTG0VywGTsSbosfvGGyH4wgyWPMTYcOKnuSCLP/ nEkA== X-Gm-Message-State: ALoCoQkAPkTHBEAsp2HuMir1G16rykm8Y2oZuSGJE9VUeaxsvcdCe7UdrwjqLJBbGgzG7hFEXtkB X-Received: by 10.194.193.4 with SMTP id hk4mr1114648wjc.71.1386060437566; Tue, 03 Dec 2013 00:47:17 -0800 (PST) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id n6sm3383274wix.3.2013.12.03.00.47.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Dec 2013 00:47:16 -0800 (PST) Date: Tue, 3 Dec 2013 09:47:31 +0100 From: Leif Lindholm To: The development of GNU GRUB Subject: Re: [PATCH, RFC, RFT] ARM relocation fixes Message-ID: <20131203084730.GS24997@rocoto.smurfnet.nu> References: <20131202112846.GC24997@rocoto.smurfnet.nu> <529C7305.5070002@gmail.com> <20131202133051.GE24997@rocoto.smurfnet.nu> <529CC74C.2060903@gmail.com> <20131202194020.GN24997@rocoto.smurfnet.nu> <529CE7DF.6000906@gmail.com> <20131202204622.GO24997@rocoto.smurfnet.nu> <529D6E1D.3010806@gmail.com> <20131203081441.GR24997@rocoto.smurfnet.nu> <529D94E0.3060402@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <529D94E0.3060402@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.170 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Dec 2013 08:47:30 -0000 On Tue, Dec 03, 2013 at 09:22:56AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > >> I've looked through encoding of those instructions and see how much it's > >> a mess. b* and b*x don't have similar set of options which makes > >> validating them a difficult error-prone task. So I think, I'll just add > >> veneers to mkimage, just like we do on ia64 (either by making a > >> pc-relative variant of veneers or adding fixup for them) > > > > Not B, BL. > > There is a 1-bit range difference between Thumb BL and BLX, which we > > need to check for anyway. This check already exists (and must exist) in > > the code. Adding veneers would be pure overhead. > > I meant that you can use conditions with bl but not blx. So if we have a > reloc on ARM bl.e targetting Thumb then we have to add veneers. Since we > have only small number of interworking calls it's probably easier to > always add veneers on interworking relative relocations rather than > having micro-optimisation and get some minor case wrong. OK, but the only place we could ever have a problem with this would be if we had asm in the kernel _explicitly_ done as .thumb. Which we don't. We explicitly moved away from that in order to have support for pre-v7 processors. All modules will have full 32-bit external references, so will not use these instructions anyway. Any internal references within modules will be linked with LD, which will fix this up automatically. / Leif