Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VnR8Z-0002o8-9t for mharc-grub-devel@gnu.org; Mon, 02 Dec 2013 05:53:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnR7u-0002cg-M9 for grub-devel@gnu.org; Mon, 02 Dec 2013 05:53:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnR7s-0006Vb-Sv for grub-devel@gnu.org; Mon, 02 Dec 2013 05:53:18 -0500 Received: from mail-we0-f177.google.com ([74.125.82.177]:65392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnR7s-0006VV-EX for grub-devel@gnu.org; Mon, 02 Dec 2013 05:53:16 -0500 Received: by mail-we0-f177.google.com with SMTP id p61so11612389wes.36 for ; Mon, 02 Dec 2013 02:53:15 -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=lXYuFEYhQ5PzsszLSikYBtTa10LeAEaLekgr9p7F/O4=; b=DgT6tlopq/Atx50cTouZcrh5scBK/MgAmzUL4qpW9qmrIfyBcTKMyMGSkJ2wyNTt5p 0P4M1oeRvsNWU9IOy9pu2NwJ2nnkRHMmMvKmPEReO8l8ETG7l4WxU3umISafE+BsDnCH K6CQSvb//G8j6sJkxi5rYKVIyiGM6NaGWn6IJZ/yh2TVrAtZjEl8gKZSVac4CWfdo7Wn FMkoYVpBFpOZctKPQURwwOmW5DXmlcee+OnV2tWKcMzS5ZRisduDaUROJQu8+xCgiGWo +Mu1PnZ4Zd/zwlHZd2V60apOXT7Rh8v2J1MJ6PC3026o4cmvMS4ANuJlcVQ7wz78V6vN 5Xdg== X-Gm-Message-State: ALoCoQm2Pt/W70OPPxJ/T0+owH5n3z2R75yNWmtZd/bayADRY12D+e0j0rZxG2Ay3vXxsfC5JAzH X-Received: by 10.180.101.230 with SMTP id fj6mr17289393wib.58.1385981595129; Mon, 02 Dec 2013 02:53:15 -0800 (PST) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id w1sm85677168wib.6.2013.12.02.02.53.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Dec 2013 02:53:14 -0800 (PST) Date: Mon, 2 Dec 2013 11:53:31 +0100 From: Leif Lindholm To: The development of GNU GRUB Subject: Re: [PATCH, RFC, RFT] ARM relocation fixes Message-ID: <20131202105330.GA24997@rocoto.smurfnet.nu> References: <529AD1E8.8010305@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <529AD1E8.8010305@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.177 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 10:53:23 -0000 On Sun, Dec 01, 2013 at 07:06:32AM +0100, Vladimir 'φ-coder/phcoder' 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 relocation > handling to EFI code (it didn't allow to use ARM (no-Thumb) binary with > EFI). > I couldn't test it on either arm-efi or ARM64 Amusingly, I wrote the attached 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 module is loaded into. I'll have a look and a poke on both 32- and 64-bit stuff and respond.. 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. / Leif [1] ARM terminology - "trampolines" for ARM refers to something generated on the stack, which we don't see anymore since the nested functions were removed.