From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbdKHU4g (ORCPT ); Wed, 8 Nov 2017 15:56:36 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:58408 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898AbdKHU4d (ORCPT ); Wed, 8 Nov 2017 15:56:33 -0500 X-Host: surveyor.tdc.vzwcorp.com From: "Levin, Alexander (Sasha Levin)" To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Matt Redfearn , "linux-mips@linux-mips.org" , Ralf Baechle , "Levin, Alexander (Sasha Levin)" Subject: [PATCH AUTOSEL for-4.4 39/39] MIPS: Use Makefile.postlink to insert relocations into vmlinux Thread-Topic: [PATCH AUTOSEL for-4.4 39/39] MIPS: Use Makefile.postlink to insert relocations into vmlinux Thread-Index: AQHTWNM+uKnh1XQhTUW3lZKZsrMQnQ== Date: Wed, 8 Nov 2017 20:50:43 +0000 Message-ID: <20171108205027.27525-39-alexander.levin@verizon.com> References: <20171108205027.27525-1-alexander.levin@verizon.com> In-Reply-To: <20171108205027.27525-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vA8KugmB003621 From: Matt Redfearn [ Upstream commit 44079d3509aee89c58f3e4fd929fa53ab2299019 ] When relocatable support for MIPS was merged, there was no support for an architecture to add a postlink step for vmlinux. This meant that only invoking a target within the boot directory, such as uImage, caused the relocations to be inserted into vmlinux. Building just the vmlinux target would result in a relocatable kernel with no relocation information present. Commit fbe6e37dab97 ("kbuild: add arch specific post-link Makefile") recified this situation, so MIPS can now define a postlink step to add relocation information into vmlinux, and remove the additional steps tacked onto boot targets. Signed-off-by: Matt Redfearn Tested-by: Steven J. Hill Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14554/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin --- arch/mips/Makefile.postlink | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 arch/mips/Makefile.postlink diff --git a/arch/mips/Makefile.postlink b/arch/mips/Makefile.postlink new file mode 100644 index 000000000000..b0ddf0701a31 --- /dev/null +++ b/arch/mips/Makefile.postlink @@ -0,0 +1,35 @@ +# =========================================================================== +# Post-link MIPS pass +# =========================================================================== +# +# 1. Insert relocations into vmlinux + +PHONY := __archpost +__archpost: + +include include/config/auto.conf +include scripts/Kbuild.include + +CMD_RELOCS = arch/mips/boot/tools/relocs +quiet_cmd_relocs = RELOCS $@ + cmd_relocs = $(CMD_RELOCS) $@ + +# `@true` prevents complaint when there is nothing to be done + +vmlinux: FORCE + @true +ifeq ($(CONFIG_RELOCATABLE),y) + $(call if_changed,relocs) +endif + +%.ko: FORCE + @true + +clean: + @true + +PHONY += FORCE clean + +FORCE: + +.PHONY: $(PHONY) -- 2.11.0