From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VnRuc-0000DW-Kf for mharc-grub-devel@gnu.org; Mon, 02 Dec 2013 06:43:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnRuU-0000DG-Me for grub-devel@gnu.org; Mon, 02 Dec 2013 06:43:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnRuJ-0006Oa-Uf for grub-devel@gnu.org; Mon, 02 Dec 2013 06:43:30 -0500 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:61487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnRuJ-0006MK-JL for grub-devel@gnu.org; Mon, 02 Dec 2013 06:43:19 -0500 Received: by mail-ea0-f170.google.com with SMTP id k10so8932849eaj.15 for ; Mon, 02 Dec 2013 03:43:18 -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=6hFPyK+UwjKVJCfbZcd8ydSf5Pa37x+2jmTJdjdPfFU=; b=LJCRbgBE10aJLh5BLgsZvwuy1Sly62c5+HhN2cMnUqF45xgDVFQ5YenkkvS3jMNgCe iuDcguy9opS4FlZbyY2TAeWvf1nyGofynUPDi4FLNCXrYDbnPjQj7g0HCgv+bSSJWV+H n8CSBQEyAFmmmmgeiANZJBMMD3zUCfNdDPJkHLatB82NL7WBLVE4jZqCqxbdSWhU6PzR rLEs/NbyjG1zmGfji6BbnAKBsFMuA/BIeTxKpJNYv0fFKkx52gIhz4NEWV7DtqVqSK7T sNAQwdbnbi+YNyc7W2YYCMotbfDZ6aNGzuPJcnUwreOVzwYFgikaG7+z8TLZj9EW91gU Uhag== X-Received: by 10.14.225.137 with SMTP id z9mr52732eep.145.1385984598684; Mon, 02 Dec 2013 03:43:18 -0800 (PST) Received: from [192.168.42.154] (146-236.197-178.cust.bluewin.ch. [178.197.236.146]) by mx.google.com with ESMTPSA id o47sm70150123eem.21.2013.12.02.03.43.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 03:43:18 -0800 (PST) Message-ID: <529C724F.3030006@gmail.com> Date: Mon, 02 Dec 2013 12:43:11 +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: <529AD1E8.8010305@gmail.com> <20131202105330.GA24997@rocoto.smurfnet.nu> <529C6820.9090902@gmail.com> <20131202112846.GC24997@rocoto.smurfnet.nu> In-Reply-To: <20131202112846.GC24997@rocoto.smurfnet.nu> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2IRFFDPLVDQEVEKQQLOVI" 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: Mon, 02 Dec 2013 11:43:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2IRFFDPLVDQEVEKQQLOVI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02.12.2013 12:28, Leif Lindholm wrote: > On Mon, Dec 02, 2013 at 11:59:44AM +0100, Vladimir '=CF=86-coder/phcode= r' Serbinenko wrote: >> On 02.12.2013 11:53, Leif Lindholm wrote: >>> On Sun, Dec 01, 2013 at 07:06:32AM +0100, Vladimir '=CF=86-coder/phco= der' Serbinenko wrote: >>>> Current ARM relocation doesn't handle the cases when the relocation = cant >>>> be satisfied directly (like thumb call over 1M of distance or jump24= to >>>> thumb mode. Attached patch adds missing tampoline and missing reloca= tion >>>> handling to EFI code (it didn't allow to use ARM (no-Thumb) binary w= ith >>>> EFI). >>>> I couldn't test it on either arm-efi or ARM64 >>> >>> Amusingly, I wrote the attached >> Nothing is attached to your mail. Right now could you pause work on >> */dl.c: I'm reorganising them to declare more of it as platform >> independent and unify handling (ARM dl.c is unnecessarily different fr= om >> other versions and forget some of ELF handling) >=20 > Ok, I'll hold off. >=20 >>> on Saturday, based on a bug report >>> from Jon Masters @ Red Hat. Although an unlikely corner case, it does= >>> probably need the addition of grub_arch_dl_get_tramp_got_size() from >>> your implementation in order to ensure the "veneers"[1] don't end up >>> in a heap region different to and too far away from the one the modul= e >>> is loaded into. >>> >>> I'll have a look and a poke on both 32- and 64-bit stuff and respond.= =2E >>> >>> I would say the modifications to grub-mkimage for arm64 are probably >>> unnessecary: AArch64 relative branch range is +-128MB, and I don't >>> think we'll see grub kernel images that big. >> >> There are no changes of this kind to mkimage. I only added missing ARM= >> handling and the functions which now became mkimage-specific were move= d >> to it. >=20 > Well, I was referring specifically to: > --- a/util/grub-mkimagexx.c > +++ b/util/grub-mkimagexx.c > @@ -731,13 +731,13 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shd= r *sections, > case R_AARCH64_JUMP26: > case R_AARCH64_CALL26: > { > - grub_err_t err; > sym_addr -=3D offset; > sym_addr -=3D SUFFIX (entry_point); > - err =3D grub_arm64_reloc_xxxx26((grub_uint32_t *= )target, > + if (!grub_arm_64_check_xxxx26_offset (sym_addr))= > + grub_util_error ("%s", _("CALL26 Relocation ou= t of range")); > + > + grub_arm64_set_xxxx26_offset((grub_uint32_t *)ta= rget, > sym_addr); > - if (err) > - grub_util_error ("%s", grub_errmsg); > } > break; > default: > which isn't wrong, but that offset test can only fail when your GRUB > kernel is greater than 128MB in size. >=20 True that's why it just aborts the image creation. > / > Leif >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2IRFFDPLVDQEVEKQQLOVI 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/ iF4EAREKAAYFAlKcck8ACgkQmBXlbbo5nOu+1wD/Zvnbav7nZTeocFqU8RkccBDY EpwYaNde0X3sukYnkOMBAK+mJLgpBTa1mQGIwfCkcLOBbvJYkXFMiN//micu66do =+pUP -----END PGP SIGNATURE----- ------enig2IRFFDPLVDQEVEKQQLOVI--