From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VxLOx-00013D-So for mharc-grub-devel@gnu.org; Sun, 29 Dec 2013 13:47:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxLOr-0000wb-Hr for grub-devel@gnu.org; Sun, 29 Dec 2013 13:47:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxLOm-0008Hm-FW for grub-devel@gnu.org; Sun, 29 Dec 2013 13:47:45 -0500 Received: from benson.vm.bytemark.co.uk ([212.110.190.137]:37721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxLOm-0008Hh-9f for grub-devel@gnu.org; Sun, 29 Dec 2013 13:47:40 -0500 Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginm.net ([86.6.25.227] helo=hastur.hellion.org.uk) by benson.vm.bytemark.co.uk with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VxLOk-0000KG-Oh; Sun, 29 Dec 2013 18:47:39 +0000 Received: by hastur.hellion.org.uk (sSMTP sendmail emulation); Sun, 29 Dec 2013 18:47:38 +0000 From: Ian Campbell To: grub-devel@gnu.org Subject: [PATCH 2/7] mkimage: Replace hardcoded 0x400 in R_ARM_ABS32 relocation Date: Sun, 29 Dec 2013 18:47:31 +0000 Message-Id: <1388342856-18317-2-git-send-email-ijc@hellion.org.uk> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1388342839.32105.25.camel@hastur.hellion.org.uk> References: <1388342839.32105.25.camel@hastur.hellion.org.uk> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.110.190.137 Cc: Vladimir Serbinenko , Leif Lindholm , Ian Campbell 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: Sun, 29 Dec 2013 18:47:50 -0000 In http://lists.gnu.org/archive/html/grub-devel/2013-04/msg00034.html Leif suggested that this should actually be "SUFFIX (entry_point)" saying: _start gets bumped down a bit, so all relative relocations need to follow, and then I "un-adjust" for the absolutes. Not too proud of that bit of code. I think this "bumping down" actually comes from the image type's vaddr_offset and therefore it is more correct to adjust by this amount. Signed-off-by: Ian Campbell Cc: leif.lindholm@linaro.org --- util/grub-mkimagexx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index d059396..f5e514f 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -868,7 +868,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, grub_util_info (" ABS32:\toffset=%d\t(0x%08x)", (int) sym_addr, (int) sym_addr); /* Data will be naturally aligned */ - sym_addr += 0x400; + sym_addr += image_target->vaddr_offset; *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr); } break; -- 1.8.4.rc3