Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp466694pxp; Fri, 11 Mar 2022 07:51:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNF2F3gMLRYLF4EXLWt+eypVezkaCBBcg9iLfOUXg1sed/X2sRNcS9GTaeadka6rQfzZMc X-Received: by 2002:a17:903:32d2:b0:151:e18b:5411 with SMTP id i18-20020a17090332d200b00151e18b5411mr11057844plr.29.1647013880473; Fri, 11 Mar 2022 07:51:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647013880; cv=none; d=google.com; s=arc-20160816; b=Uc3wvkFxOewigxuMOz7eJZOWDrPKZUIHllxbE5p8/towafOiJs+n5qP6tEOZ7G+8w7 hWIv1ml4Dxo1CgBsUTT4vJVX+o0cvZkldD4+FlWG9n62GI67qCQlxBdsEYe5whssKq86 JY7bX2x75NXlDnEUHgkDc6ouUAZZ6rQDQtvJlv1uZ++s+tHXYSMuIpjsdR6bdzZcWyCI QveNiHZevLMcVJQWZkLTGCMfBKMJ5nB3lwbfhaf8HBopelzo0OeolCN3qZb6kxXqacsR 2K8pYGAX48Iz1wZuCsb8s30EySVKOIrMwWWrY4jCjunBbwMOwGpc7kQ/1iVM1o0xFyer vwaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gpvSxCGI9G5ZKniSwAbV5F0SkN5fQfOXJtHI9pw3K44=; b=OpI7k2mlBa7vdMM1+ce2e6LPa64AO0aOH9eW/ZSOTeXugmNZnCGRWj4xgYVz0wc1wY jB+cDiWlD78CIPvp5Asu/sm0jFqvEuxRCrx1qu+Ha26Ftb/Tu4553PaAZuNbQ1tRk1pe wO5tH8H/bRuEvUn0w9AyoNwntSpiVULbLzWfsuimdugfVParS3zp4IqaRybyUuKM4ixp mxbSrz45zpRny3HGfogKXpzqk7CMJv3an4AnXzkiXHeGTl+8ChcNfHchp2nKu/ZNe+vL xB5NAG4bwPnaQDGNKYlbuXNWRo1ljTtKH/I/GeptN9AszQDAQJkrNevY/AmUzDjr90Eo YFtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UYAulTbk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a17090aa40600b001bd14e03042si5400677pjp.26.2022.03.11.07.51.04; Fri, 11 Mar 2022 07:51:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UYAulTbk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243547AbiCJOZu (ORCPT + 99 others); Thu, 10 Mar 2022 09:25:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243369AbiCJOVp (ORCPT ); Thu, 10 Mar 2022 09:21:45 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D2D0B250C; Thu, 10 Mar 2022 06:20:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EEEF2B82670; Thu, 10 Mar 2022 14:20:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E5AAC340EB; Thu, 10 Mar 2022 14:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646922029; bh=Yd5n5DSjjVDG87tEbvo0EgJLSt9bMab9/62XTFXxw2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UYAulTbk672MnC19J11fdrM8FQFV8jUTHRWv0OsphYQoUPGskJ24NLcCQ3fWeZxG6 e8Y5Z+nfhWqm8JEMWoKJ7ORRkQ8QfH9eI2JEVT6lCGbBnakYdRbj4CwvW7Rs3+2zpR 7tWbdayWaYneJPGwufqh85FNTaN+XRs9z8E8j650= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Catalin Marinas , "Russell King (Oracle)" Subject: [PATCH 4.14 15/31] ARM: use LOADADDR() to get load address of sections Date: Thu, 10 Mar 2022 15:18:28 +0100 Message-Id: <20220310140807.979965576@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140807.524313448@linuxfoundation.org> References: <20220310140807.524313448@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Russell King (Oracle)" commit 8d9d651ff2270a632e9dc497b142db31e8911315 upstream. Use the linker's LOADADDR() macro to get the load address of the sections, and provide a macro to set the start and end symbols. Acked-by: Catalin Marinas Signed-off-by: Russell King (Oracle) Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/vmlinux-xip.lds.S | 19 ++++++++++++------- arch/arm/kernel/vmlinux.lds.S | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -13,6 +13,11 @@ #include #include +/* Set start/end symbol names to the LMA for the section */ +#define ARM_LMA(sym, section) \ + sym##_start = LOADADDR(section); \ + sym##_end = LOADADDR(section) + SIZEOF(section) + #define PROC_INFO \ . = ALIGN(4); \ VMLINUX_SYMBOL(__proc_info_begin) = .; \ @@ -149,19 +154,19 @@ SECTIONS * The vectors and stubs are relocatable code, and the * only thing that matters is their relative offsets */ - __vectors_start = .; + __vectors_lma = .; .vectors 0xffff0000 : AT(__vectors_start) { *(.vectors) } - . = __vectors_start + SIZEOF(.vectors); - __vectors_end = .; + ARM_LMA(__vectors, .vectors); + . = __vectors_lma + SIZEOF(.vectors); - __stubs_start = .; - .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { + __stubs_lma = .; + .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_lma) { *(.stubs) } - . = __stubs_start + SIZEOF(.stubs); - __stubs_end = .; + ARM_LMA(__stubs, .stubs); + . = __stubs_lma + SIZEOF(.stubs); PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors)); --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -15,6 +15,11 @@ #include #include +/* Set start/end symbol names to the LMA for the section */ +#define ARM_LMA(sym, section) \ + sym##_start = LOADADDR(section); \ + sym##_end = LOADADDR(section) + SIZEOF(section) + #define PROC_INFO \ . = ALIGN(4); \ VMLINUX_SYMBOL(__proc_info_begin) = .; \ @@ -170,19 +175,19 @@ SECTIONS * The vectors and stubs are relocatable code, and the * only thing that matters is their relative offsets */ - __vectors_start = .; + __vectors_lma = .; .vectors 0xffff0000 : AT(__vectors_start) { *(.vectors) } - . = __vectors_start + SIZEOF(.vectors); - __vectors_end = .; + ARM_LMA(__vectors, .vectors); + . = __vectors_lma + SIZEOF(.vectors); - __stubs_start = .; - .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { + __stubs_lma = .; + .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_lma) { *(.stubs) } - . = __stubs_start + SIZEOF(.stubs); - __stubs_end = .; + ARM_LMA(__stubs, .stubs); + . = __stubs_lma + SIZEOF(.stubs); PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));