From patchwork Thu Oct 23 04:43:45 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 5416 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id D5895DDF34 for ; Thu, 23 Oct 2008 15:45:14 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1003) id 1E75EDDEF8; Thu, 23 Oct 2008 15:44:13 +1100 (EST) MIME-Version: 1.0 Message-ID: <18688.257.812926.680480@drongo.ozlabs.ibm.com> Date: Thu, 23 Oct 2008 15:43:45 +1100 From: Paul Mackerras To: linuxppc-dev@ozlabs.org Subject: [PATCH] Work around ld bug in older binutils X-Mailer: VM 8.0.11 under Emacs 22.2.1 (powerpc-unknown-linux-gnu) X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Commit 549e8152de8039506f69c677a4546e5427aa6ae7 ("powerpc: Make the 64-bit kernel as a position-independent executable") added lines to vmlinux.lds.S to add the extra sections needed to implement a relocatable kernel. However, those lines seem to trigger a bug in older versions of GNU ld (such as 2.16.1) when building a non-relocatable kernel. Since ld 2.16.1 is still a popular choice for cross-toolchains, this adds an #ifdef to vmlinux.lds.S so the added lines are only included when building a relocatable kernel. Signed-off-by: Paul Mackerras diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index b39c27e..384dca5 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -187,6 +187,7 @@ SECTIONS *(.machine.desc) __machine_desc_end = . ; } +#ifdef CONFIG_RELOCATABLE . = ALIGN(8); .dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET) { *(.dynsym) } .dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) } @@ -202,6 +203,7 @@ SECTIONS __rela_dyn_start = .; *(.rela*) } +#endif /* Fake ELF header containing RPA note; for addnote */ .fakeelf : AT(ADDR(.fakeelf) - LOAD_OFFSET) { *(.fakeelf) }