Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VnUGv-000111-Tc for mharc-grub-devel@gnu.org; Mon, 02 Dec 2013 09:14:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnUGo-0000yh-TD for grub-devel@gnu.org; Mon, 02 Dec 2013 09:14:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnUGi-0005cT-TI for grub-devel@gnu.org; Mon, 02 Dec 2013 09:14:42 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:62724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnUGi-0005cK-Nb for grub-devel@gnu.org; Mon, 02 Dec 2013 09:14:36 -0500 Received: by mail-we0-f172.google.com with SMTP id w62so6413182wes.3 for ; Mon, 02 Dec 2013 06:14:36 -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:in-reply-to :user-agent; bh=WSDI7QTdeywv0OsgX/W+ie9uvd+4G7k6LnyXLSsxQq0=; b=i4PEQ1ATHuUGLZngbsDEIMYXmvOS1Y3rk2xn8T/vvIJl/fwXw6SLfHs/H9MaExcrwZ xsNG2Pz5enVvTmdh8WTgFnxIzoBtq3AavJ773zqD9T5uG9SIEuWIHjaRKTYm07kJijyC e+7v1F8qIBwm5hoVxMdnepZvv12bh7Yp86K8byEPvtiOoN6rntpHwRNja3Vgi3ZZd78Y 6V3WrAZo9Rs/DRYY+6JNYjPN//0uyTyjhaUY4MqsS8zYdDxOeuGsE8q1djDM5slSACxb L5ysMrqzs9USiFOc5DcZsnvnN1jIyEx5RA/dgrhl7rY7WutyEJKAtY64sJaUBH5Tk/8C mOVg== X-Gm-Message-State: ALoCoQkGZV2MTXJrr7lyV5sige38scNYploJb6SsGx0N5n9ghxBkFZaz+IxVWSNX7UrskS+8F5pJ X-Received: by 10.194.19.228 with SMTP id i4mr34877wje.87.1385993675941; Mon, 02 Dec 2013 06:14:35 -0800 (PST) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id gb1sm122855391wic.0.2013.12.02.06.14.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Dec 2013 06:14:35 -0800 (PST) Date: Mon, 2 Dec 2013 15:14:50 +0100 From: Leif Lindholm To: The development of GNU GRUB Subject: Re: [PATCH, RFC, RFT] ARM relocation fixes Message-ID: <20131202141450.GG24997@rocoto.smurfnet.nu> References: <529AD1E8.8010305@gmail.com> <20131202105330.GA24997@rocoto.smurfnet.nu> <529C6820.9090902@gmail.com> <20131202112846.GC24997@rocoto.smurfnet.nu> <529C7305.5070002@gmail.com> <20131202133051.GE24997@rocoto.smurfnet.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131202133051.GE24997@rocoto.smurfnet.nu> 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.172 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 14:14:49 -0000 On Mon, Dec 02, 2013 at 02:30:51PM +0100, Leif Lindholm wrote: > > >>> 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 from > > >> other versions and forget some of ELF handling) > > > > > > Ok, I'll hold off. > > > > > I've uploaded current work to phcoder/reloc > > Ok, so I've tested this on arm64, and it works on the commercial FVP > Base model (which does not trigger veneer generation due to its runtime > memory map), but crashes on the Foundation model (which does). > So the generic dl refactoring seems correct, but somehing about the > veneers is fishy. Well, this one seems to be because mod->trampptr is never initilised (which should be a problem also on the other archs?). With diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index 33ccc98..92027e0 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -317,6 +317,7 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) #if !defined (__i386__) && !defined (__x86_64__) && !defined (__sparc__) ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, GRUB_ARCH_DL_TRAMP_ALIGN); mod->tramp = ptr; + mod->trampptr = (ptr + tramp); ptr += tramp; ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, GRUB_ARCH_DL_GOT_ALIGN); mod->got = ptr; This runs successfully on my foundation model. Presumably, on other architectures a similar thing for mod->gotptr is required? / Leif