From patchwork Wed Apr 20 04:15:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 1116 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:49:16 -0000 Delivered-To: patches@linaro.org Received: by 10.224.67.148 with SMTP id r20cs98791qai; Tue, 19 Apr 2011 21:15:32 -0700 (PDT) Received: by 10.52.95.108 with SMTP id dj12mr2785809vdb.39.1303272932286; Tue, 19 Apr 2011 21:15:32 -0700 (PDT) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx.google.com with ESMTP id u9si499221vdt.142.2011.04.19.21.15.32; Tue, 19 Apr 2011 21:15:32 -0700 (PDT) Received-SPF: neutral (google.com: 24.201.245.36 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) client-ip=24.201.245.36; Authentication-Results: mx.google.com; spf=neutral (google.com: 24.201.245.36 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) smtp.mail=nicolas.pitre@linaro.org Content-transfer-encoding: 7BIT Received: from xanadu.home ([66.130.28.92]) by vl-mh-mrz25.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <0LJX00FLENR4V170@vl-mh-mrz25.ip.videotron.ca> for patches@linaro.org; Wed, 20 Apr 2011 00:13:53 -0400 (EDT) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Tony Lindgren , Shawn Guo Subject: [PATCH 3/3] ARM: zImage: fix issues with missing GOT entries for some global variables Date: Wed, 20 Apr 2011 00:15:04 -0400 Message-id: <1303272904-31392-4-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.7.4 In-reply-to: <1303272904-31392-1-git-send-email-nicolas.pitre@linaro.org> References: <1303272904-31392-1-git-send-email-nicolas.pitre@linaro.org> Many architecture specific versions of uncompress.h make use of global variables marked static. In such case the GOT is bypassed and the code in head.S can't relocate them. Instead of removing the static keyword from all those files and hope that it won't come back, let's simply define it out. Signed-off-by: Nicolas Pitre Tested-by: Tony Lindgren --- This should fix remaining issues some people have with the DT append patch. arch/arm/boot/compressed/misc.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index a565853..0125dae 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c @@ -30,7 +30,20 @@ unsigned int __machine_arch_type; static void putstr(const char *ptr); extern void error(char *x); +/* + * Many instances of mach/uncompress.h are including global variables. + * Contrary to standard usage, we should _not_ mark those variables + * static otherwise they get accessed via GOTOFF references which cannot + * be modified at run time. The entry code in head.S relies on the ability + * to move writable sections around, and for that to work, we must have all + * references going through the GOT which works only with non static + * variables. So, instead of asking for a non intuitive requirement + * making many files non standard according to accepted coding practices + * we fix the issue here by simply defining the static keyword to nothing. + */ +#define static /* non-static */ #include +#undef static #ifdef CONFIG_DEBUG_ICEDCC