From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754089AbdKIJRG (ORCPT ); Thu, 9 Nov 2017 04:17:06 -0500 Received: from 19pmail.ess.barracuda.com ([64.235.154.231]:44460 "EHLO 19pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754041AbdKIJRC (ORCPT ); Thu, 9 Nov 2017 04:17:02 -0500 Subject: Re: [PATCH AUTOSEL for-4.4 39/39] MIPS: Use Makefile.postlink to insert relocations into vmlinux To: "Levin, Alexander (Sasha Levin)" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Matt Redfearn , "linux-mips@linux-mips.org" , Ralf Baechle References: <20171108205027.27525-1-alexander.levin@verizon.com> <20171108205027.27525-39-alexander.levin@verizon.com> From: Matt Redfearn Message-ID: Date: Thu, 9 Nov 2017 09:16:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171108205027.27525-39-alexander.levin@verizon.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.150.130.83] X-BESS-ID: 1510219006-321457-5685-46572-1 X-BESS-VER: 2017.12-r1710252241 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.186748 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/11/17 20:50, Levin, Alexander (Sasha Levin) wrote: > 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") Hi, This patch depends on upstream commit fbe6e37dab97 ("kbuild: add arch specific post-link Makefile") which was introduced in v4.9. This patch is an improvement to the build flow and I would not consider it for backporting - certainly not to v4.8 or earlier which is missing the dependency. Applying it will not break anything, however, it will perform no function either without the supporting dependency. Thanks, Matt > 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)