From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WIjHj-0002cW-DJ for mharc-grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIjHW-0002Dq-20 for grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIjHM-0001JS-Je for grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:33 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:38798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIjHM-0001JF-Co for grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:24 -0500 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Feb 2014 11:32:24 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 26 Feb 2014 11:32:23 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A6A0B1FF003B for ; Wed, 26 Feb 2014 11:32:22 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp07029.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1QGTf6G12124628 for ; Wed, 26 Feb 2014 17:29:41 +0100 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1QIWMZG018544 for ; Wed, 26 Feb 2014 11:32:22 -0700 Received: from ram.oc3035372033.ibm.com.com (sig-9-65-83-23.mts.ibm.com [9.65.83.23]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s1QIVZLi014663; Wed, 26 Feb 2014 11:32:20 -0700 From: Ram Pai To: grub-devel@gnu.org Subject: [RFC PATCH 19/23] align .toc section on 4byte boundary. Date: Wed, 26 Feb 2014 10:31:18 -0800 Message-Id: <1393439482-20341-20-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1393439482-20341-1-git-send-email-linuxram@us.ibm.com> References: <1393439482-20341-1-git-send-email-linuxram@us.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14022618-6688-0000-0000-000007007F39 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.110.153 Cc: tonyb@au1.ibm.com, anton@au1.ibm.com, linuxram@us.ibm.com, tlfalcon@linux.vnet.ibm.com, tbberry@us.ibm.com 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: Wed, 26 Feb 2014 18:32:44 -0000 the .toc section in powerpc64le modules are sometimes not aligned on a four byte boundary. This fails the module linker especially when processing R_PPC64_TOC16_LO_DS, since the addresses are expected to be aligned on 4byte boundary. Signed-off-by: Ram Pai --- grub-core/kern/dl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index ce2ff38..ee69c3c 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -304,7 +304,12 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) { void *addr; +#ifdef __powerpc64le__ + ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, + (s->sh_addralign < 4 ? 4 : s->sh_addralign)); +#else ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, s->sh_addralign); +#endif addr = ptr; ptr += s->sh_size; -- 1.8.5.3