From patchwork Fri Nov 22 16:29:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 3223381 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1524BC045B for ; Fri, 22 Nov 2013 16:29:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA2A7207A1 for ; Fri, 22 Nov 2013 16:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A9612079E for ; Fri, 22 Nov 2013 16:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755626Ab3KVQ34 (ORCPT ); Fri, 22 Nov 2013 11:29:56 -0500 Received: from mout.gmx.net ([212.227.15.18]:61025 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755568Ab3KVQ3z (ORCPT ); Fri, 22 Nov 2013 11:29:55 -0500 Received: from ls3530.dhcp.wdf.sap.corp ([155.56.40.73]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LwJRe-1VbdDL3TNG-017zC0 for ; Fri, 22 Nov 2013 17:29:53 +0100 Date: Fri, 22 Nov 2013 17:29:52 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley Subject: [PATCH] parisc: vmlinux.lds.S: fix linkage of the 64bit SMP debian kernel Message-ID: <20131122162952.GA10699@ls3530.dhcp.wdf.sap.corp> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:6ladFMWckCXSh5rmdJOxcGJZj4zAKZyeO67rdz+CPrsfwhXnbkW UyxCMB4yBRQ7539QZr3zKsIBK+8jOBnV5Se+d9ud88rzXh0d25VLYN8Hs0HJhWHcVUhAuDs b2TmbPNpZGm9rVr4n3Pj9wz2N2HG4PS+O3oUoYHJg/DdeZQ6wxBfqzSxLLmc28S0pvHTyI3 9XZACFuLG7iip1is4OQRw== Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building the 64bit SMP kernel for debian it may happen that it becomes too big so that functions in the .init.text or .exit.text may not be able to reach important kernel functions in the .text section. Main reason why this happens with a 64bit kernel build is that we include the linkage tables (.opd, .plt, .dlt) in that data section. Those linkage tables tend to become huge, and since they are located between the .text and the .init sections the distance gets too far. If the linker fails to link vmlinux, it will either crash without any error message, or it will - with newer linker versions - report the following error: hppa64-linux-gnu-ld: drivers/built-in.o(.exit.text+0xc4): cannot reach _raw_read_lock drivers/built-in.o: In function `pdc_stable_exit': drivers/parisc/pdc_stable.o:(.exit.text+0xc4): relocation truncated to fit: R_PARISC_PCREL22F against symbol `_raw_read_lock' defined in .spinlock.text section in kernel/built-in.o We have three options to solve this issue: a) Turn on CONFIG_MLONGCALLS, which will instruct the compiler to use the -mlongcall option. But this option will hurt performance. b) Tell the linker (via vmlinux.lds.S) to move the .init.text and .exit.text sections into the normal .text section. Downside here is, that those sections will not be discarded at runtime. c) Move the linkage tables somewhere else. Even if this would be possible I did not find a nice solution without any other bad side effects. Since we are compiling a 64bit kernel which usually runs on machines with lots of memory, I preferred option b) since performance is usually more imortant than some lost memory area. Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index 4bb095a..f16fa7d 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -67,6 +78,10 @@ SECTIONS *(.fixup) *(.lock.text) /* out-of-line lock text */ *(.gnu.warning) +#if defined(CONFIG_64BIT) && !defined(CONFIG_MLONGCALLS) + INIT_TEXT + EXIT_TEXT +#endif } /* End of text section */ _etext = .;