From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbdG1P1m (ORCPT ); Fri, 28 Jul 2017 11:27:42 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:36862 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975AbdG1P1k (ORCPT ); Fri, 28 Jul 2017 11:27:40 -0400 Date: Fri, 28 Jul 2017 11:27:38 -0400 (EDT) From: Nicolas Pitre To: Arnd Bergmann cc: linux-arm-kernel@lists.infradead.org, Peter Zijlstra , Matt Hart , Stefan Agner , Chris Brandt , Ard Biesheuvel , Russell King , Russell King , linux-kernel@vger.kernel.org Subject: Re: [PATCH] [RFC] ARM: move __bug_table into .data for XIP_KERNEL In-Reply-To: <20170728141108.1283320-1-arnd@arndb.de> Message-ID: References: <20170728141108.1283320-1-arnd@arndb.de> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 28 Jul 2017, Arnd Bergmann wrote: > Matt Hart reports that vf610m4_defconfig kernels grew to 2GB > xipImage size after the __bug_table change. > > I tried out a few things and found that moving the bug table > into the .data section avoids this problem. However, the > linker script magic is beyond my capabilities here, so this > is almost certainly not correct. Well, before your patch the BUG_TABLE location as well as its runtime functionality were completely wrong and broken. > I've added a few people to Cc that understand this better > than I do, hopefully someone can turn my bogus patch into > a proper one. Your patch isn't as bad as you make it, but maybe the following will avoid open recoding BUG_TABLE locally: diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 8265b11621..21b4b29c2f 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -237,13 +237,13 @@ SECTIONS */ DATA_DATA CONSTRUCTORS - - _edata = .; } - _edata_loc = __data_loc + SIZEOF(.data); BUG_TABLE + _edata = .; + _edata_loc = __data_loc + SIZEOF(.data); + #ifdef CONFIG_HAVE_TCM /* * We align everything to a page boundary so we can Nicolas