From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VnmKJ-0007Lw-7r for mharc-grub-devel@gnu.org; Tue, 03 Dec 2013 04:31:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnmKA-0007Gl-2g for grub-devel@gnu.org; Tue, 03 Dec 2013 04:31:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnmK4-0004L9-J6 for grub-devel@gnu.org; Tue, 03 Dec 2013 04:31:22 -0500 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:42866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnmK4-0004Kx-C4 for grub-devel@gnu.org; Tue, 03 Dec 2013 04:31:16 -0500 Received: by mail-ea0-f170.google.com with SMTP id k10so9875170eaj.29 for ; Tue, 03 Dec 2013 01:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=6ULMJLEZT+XfzNTA1YkQbbwG5rz+7wbqNppyxLNqpCk=; b=Uvl5m7s1t3u3yHJz8AVaYyiVEUAnS87ZH+qLsBRGq+GShu432rTH6oNMbyS2pFaRo7 v4glzTDjXmuEWxSjUsGkJjoLSacDmhrywFgTB/014HsgAFIJqGeUDkBDU/q5vH6BUOmw zWgrOeZ6YAg2t4YjLbTmwETM4WLks8ZBMjrpomaQ3WPkEklJapD0i+Nj1+muI552hmUB U8ljs96kgtZ2LOL1Je7nieB0WbHvUgAMyqSHeMSMuc/UNtrq4AjzkDm1Dh320JUEBLb3 jiZ26tJFhXAqQFSWpWK1u/051iYLoFbvKBM1rkaBRoMFtxemI8AhR9149nQoJC9Y4Lwt 6eQQ== X-Received: by 10.14.0.201 with SMTP id 49mr5628886eeb.38.1386063075530; Tue, 03 Dec 2013 01:31:15 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id n1sm80400000eep.20.2013.12.03.01.31.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 01:31:14 -0800 (PST) Message-ID: <529DA4E1.8050201@gmail.com> Date: Tue, 03 Dec 2013 10:31:13 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH, RFC, RFT] ARM relocation fixes 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> <20131203084730.GS24997@rocoto.smurfnet.nu> In-Reply-To: <20131203084730.GS24997@rocoto.smurfnet.nu> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2VNQAIOLRNHWWRAAAXMAE" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22a 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 09:31:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2VNQAIOLRNHWWRAAAXMAE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03.12.2013 09:47, Leif Lindholm wrote: > On Tue, Dec 03, 2013 at 09:22:56AM +0100, Vladimir '=CF=86-coder/phcode= r' 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. >=20 > 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. >=20 We also call C code from asm. One such instance (for division instructions) caused the problem > 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. >=20 In my small test I compiled: extern void g(void); void f (int x) { if (!x) g(); } And got following assembly with -Os: 0: e3500000 cmp r0, #0 4: e92d4008 push {r3, lr} 8: 0bfffffe bleq 0 8: R_ARM_JUMP24 g c: e8bd4008 pop {r3, lr} 10: e12fff1e bx lr If g is a function in thumb kernel or thumb module then you need a veneer= =2E > / > Leif >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2VNQAIOLRNHWWRAAAXMAE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKdpOEACgkQmBXlbbo5nOtwrwD/YPTi+LHta7pveKT5HuwCbRjx 5OPPlEoqb6nNaiof3BgA/2yTsEAaSi4AY/woMkwsrh+YiAb3GgR9bbXkQltVlx2b =GxxL -----END PGP SIGNATURE----- ------enig2VNQAIOLRNHWWRAAAXMAE--