From patchwork Fri Mar 9 03:20:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 10269593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 91C596037E for ; Fri, 9 Mar 2018 03:23:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8461029CA0 for ; Fri, 9 Mar 2018 03:23:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78A3A29CA4; Fri, 9 Mar 2018 03:23:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED2D229CA0 for ; Fri, 9 Mar 2018 03:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rtBu0dos6valRvC3T8M7c91zDtx+s6O+rjcP8J+y124=; b=Y1hveORW9Naa+awUIjoTzU5zTf oB72G6bCggHNnI/maPWWCKJbVwY2YVVnS3cWhvjTOzc5aTaG3pNyCHc3DliayovWiLyvqhQp6EbBd V5gw6dwtwPdOHzfbdB4W3MzmdVZrlWzyOxTFi1mU51/fs0Vhf20jdjtn8fVCjm+sgLz/t6lLZs9PN aIwmX4NlX8deFBCTBX9DS4TADiSyrNmadzWHsNfP0l41mM8ijh/UJIpAlB/Za9ZXzsbTwsSSki6Rc 9Bf1hVDMcKMPO3UzG4C8Up+sBVAm4YzqgEGilXmwnoRfwZqqQlpv5Kh7taDF5K1BdjXCDOKM/LBrP Shb7y59g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eu8cw-0001B1-DV; Fri, 09 Mar 2018 03:23:26 +0000 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eu8bH-0000Au-49 for linux-arm-kernel@lists.infradead.org; Fri, 09 Mar 2018 03:21:48 +0000 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 88C5ED55E5; Thu, 8 Mar 2018 22:21:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=sasl; bh=KdBq zbXJclW69NZyOuh8s2oVjpo=; b=RlW9S7Dj9s7WIK4/qwwgno2dce0qHHu3BKlq NL58tGS1n3m9kV0dNDkJXx6ajjTiLkAT7raftoZEv71H2fGxF0MxkO0S2SJyTuPO JviaVcNFEq7IY6+oZShzmkzqfWIG7FSNSaaRX8dyEdMEzET4k8VwBT1Xt5jsYwDj 90RkZn8= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 8103AD55E4; Thu, 8 Mar 2018 22:21:30 -0500 (EST) Received: from yoda.home (unknown [70.82.104.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 19535D55E2; Thu, 8 Mar 2018 22:21:30 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id ACEC02DA062E; Thu, 8 Mar 2018 22:21:28 -0500 (EST) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/7] ARM: linker script: factor out vectors and stubs Date: Thu, 8 Mar 2018 22:20:58 -0500 Message-Id: <20180309032100.31039-6-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180309032100.31039-1-nicolas.pitre@linaro.org> References: <20180309032100.31039-1-nicolas.pitre@linaro.org> X-Pobox-Relay-ID: F5AD0E9E-2348-11E8-8A47-44CE1968708C-78420484!pb-smtp1.pobox.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180308_192143_378629_462451AF X-CRM114-Status: GOOD ( 12.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Brandt , Russell King - ARM Linux MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nicolas Pitre --- arch/arm/kernel/vmlinux-xip.lds.S | 21 +-------------------- arch/arm/kernel/vmlinux.lds.S | 21 +-------------------- arch/arm/kernel/vmlinux.lds.h | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 65048708e4..5a50a2a917 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -73,26 +73,7 @@ SECTIONS _etext = .; /* End of text and rodata section */ - /* - * The vectors and stubs are relocatable code, and the - * only thing that matters is their relative offsets - */ - __vectors_start = .; - .vectors 0xffff0000 : AT(__vectors_start) { - *(.vectors) - } - . = __vectors_start + SIZEOF(.vectors); - __vectors_end = .; - - __stubs_start = .; - .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { - *(.stubs) - } - . = __stubs_start + SIZEOF(.stubs); - __stubs_end = .; - - PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors)); - + ARM_VECTORS INIT_TEXT_SECTION(8) .exit.text : { ARM_EXIT_KEEP(EXIT_TEXT) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 3b375d8ccb..2b89363090 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -86,26 +86,7 @@ SECTIONS #endif __init_begin = .; - /* - * The vectors and stubs are relocatable code, and the - * only thing that matters is their relative offsets - */ - __vectors_start = .; - .vectors 0xffff0000 : AT(__vectors_start) { - *(.vectors) - } - . = __vectors_start + SIZEOF(.vectors); - __vectors_end = .; - - __stubs_start = .; - .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { - *(.stubs) - } - . = __stubs_start + SIZEOF(.stubs); - __stubs_end = .; - - PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors)); - + ARM_VECTORS INIT_TEXT_SECTION(8) .exit.text : { ARM_EXIT_KEEP(EXIT_TEXT) diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/kernel/vmlinux.lds.h index 566a7b42a0..0a4682ecc4 100644 --- a/arch/arm/kernel/vmlinux.lds.h +++ b/arch/arm/kernel/vmlinux.lds.h @@ -92,3 +92,24 @@ *(.ARM.extab*) \ __stop_unwind_tab = .; \ } + +/* + * The vectors and stubs are relocatable code, and the + * only thing that matters is their relative offsets + */ +#define ARM_VECTORS \ + __vectors_start = .; \ + .vectors 0xffff0000 : AT(__vectors_start) { \ + *(.vectors) \ + } \ + . = __vectors_start + SIZEOF(.vectors); \ + __vectors_end = .; \ + \ + __stubs_start = .; \ + .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { \ + *(.stubs) \ + } \ + . = __stubs_start + SIZEOF(.stubs); \ + __stubs_end = .; \ + \ + PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));