From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932811AbcIBQgi (ORCPT ); Fri, 2 Sep 2016 12:36:38 -0400 Received: from mail-he1eur01on0134.outbound.protection.outlook.com ([104.47.0.134]:29600 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932643AbcIBQgg (ORCPT ); Fri, 2 Sep 2016 12:36:36 -0400 X-Greylist: delayed 24285 seconds by postgrey-1.27 at vger.kernel.org; Fri, 02 Sep 2016 12:36:36 EDT From: "Wiebe, Wladislav (Nokia - DE/Ulm)" To: Russell King - ARM Linux CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] ARM: fix linker call for ARM_MODULE_PLTS Thread-Topic: [PATCH] ARM: fix linker call for ARM_MODULE_PLTS Thread-Index: AdIE+nrtyZhjwIi8Qbm+WoumiJd9MgAAV/IAAAB5okA= Date: Fri, 2 Sep 2016 12:02:43 +0000 Message-ID: References: <20160902092450.GB1041@n2100.armlinux.org.uk> In-Reply-To: <20160902092450.GB1041@n2100.armlinux.org.uk> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=wladislav.wiebe@nokia.com; x-originating-ip: [131.228.32.181] x-ms-office365-filtering-correlation-id: 3c38f621-641c-4ed2-c65f-08d3d3290c46 x-microsoft-exchange-diagnostics: 1;HE1PR07MB1481;6:v1vP7xcz+LP0HvG90vWuNT6yM4FO00SYHBKAoGrOR6VZp0KzPe2u25o6WhgXu6+BRwHKs0nTDeq51RA8ESfpTOmWG3fYqQ9EU4sep01j73mq7OQuD/OCwzIIz1g2CaZ3K0HA59FdJmKfiF3SpAwfyeITZIf7HDdhdJ+KfHVYT4EogSHcYqsaExQNmLcZf708NMU/jtSCDICgd4wUbdseJAWTRLzy/ocpS7c7VPQFgw3JmocGCxJIHl4lFUiLzoWhBEjas9MrKiv2tvHJFB82uLuzpsgHENjNwSxOhsVBnIKJhr+X1U8KNi5MlGoEZmn3CQcxK6070NSamdOYmNGEeQ==;5:zkjQksMeTwscxYSbLjsla8fIbXUejIRXioygqumGR8NABv3of5405XmEomVVQ49XGlKBhFzySZeH4t6iESNt3lRuMs6kGJ5e9RJQumvnjAj79xzPN/gp7GPcFNxMwV7Ypy17TOEfiCHhwBjNMzAyDQ==;24:a5FGMlyUPXi+vdtabVBjZnZOjrBxya4LE8PTkAKacwOI3bYcjrsDIGSKYVkAg9wxH0RrqLpFsKH4eFrN8byC6PweVMthtrGgoCeJ3pEj4es=;7:+VjtMdcDqyIDuaHNSIJxyLdjgb0HDVuBbIYm7+aemMjEpEKcH9BIYq2Av4X44/8+sqTqYTcoU+lTeEDPH+H51Y13qn40m9lZwUWIto0v/N9cND1IvW3Ngnh5Zt/n67RUuv6KKB/o1UowqSn7kYj/4+4t69kOVuzMrCJ6vzl0WDhxKnsDHGmDCXEI79YaY26NoSvraYK2vdHC0seeWu8mMBnhLrZV8RRSkG9iihIFD2YzEDyz+8OziOq6KOumExax x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR07MB1481; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(82608151540597)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:HE1PR07MB1481;BCL:0;PCL:0;RULEID:;SRVR:HE1PR07MB1481; x-forefront-prvs: 00531FAC2C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(24454002)(52314003)(377454003)(189002)(199003)(8676002)(3846002)(68736007)(110136002)(102836003)(6116002)(76576001)(92566002)(97736004)(189998001)(11100500001)(81166006)(105586002)(3280700002)(33656002)(8936002)(81156014)(66066001)(86362001)(586003)(122556002)(2906002)(15975445007)(9686002)(106356001)(2900100001)(101416001)(4326007)(305945005)(87936001)(5002640100001)(5660300001)(19580395003)(50986999)(19580405001)(77096005)(54356999)(7736002)(7846002)(7696003)(76176999)(10400500002)(3660700001)(74316002)(2950100001);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR07MB1481;H:HE1PR07MB1483.eurprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2016 12:02:43.9454 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1481 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 mail.home.local id u82GamlH021242 > From: Russell King - ARM Linux [mailto:linux@armlinux.org.uk] > Sent: Friday, September 02, 2016 11:25 AM > > On Fri, Sep 02, 2016 at 09:17:58AM +0000, Wiebe, Wladislav (Nokia - DE/Ulm) > wrote: > > module.lds script doesn't get called when > > CONFIG_ARM_MODULE_PLTS is enabled. > > Use KBUILD_LDFLAGS_MODULE to fix it. > > For those of us who haven't encountered this problem, could you include > some commentry in the commit message describing the failure mechanism > and why you think this is the correct solution? > > The final link for modules is: > > quiet_cmd_ld_ko_o = LD [M] $@ > cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \ > $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ > -o $@ $(filter-out FORCE,$^) > > which seems to always include both flags. Why is it ignored when it's > in LDFLAGS_MODULE? What about the other flags we pass in > LDFLAGS_MODULE? aah -- just found an issue in my environment where LDFLAGS_MODULE gets overwritten due to a none upstream patch on scripts/Makefile.modpost. It worked only for me when using the KBUILD_LDFLAGS_MODULE and I did not get deep inside after I saw in https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt +++++ KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options used when linking modules. This is often a linker script. From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). +++++ and found that all other architectures are also users of KBUILD_LDFLAGS_MODULE for that purpose $ git grep LDFLAGS_MODULE arch/ arch/arm/Makefile:LDFLAGS_MODULE += --be8 arch/arm/Makefile:LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds arch/arm64/Makefile:KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds arch/hexagon/Makefile:# LDFLAGS_MODULE += -shared arch/ia64/Makefile:KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds arch/m68k/Makefile:KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds arch/powerpc/Makefile:KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o arch/powerpc/Makefile: KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ Anyway, feel free to ignore this patch and thanks a lot for the fast feedback. > > Thanks. > > > > > Signed-off-by: Wladislav Wiebe > > --- > > arch/arm/Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > > index 61f6ccc..01c6025 100644 > > --- a/arch/arm/Makefile > > +++ b/arch/arm/Makefile > > @@ -20,7 +20,7 @@ LDFLAGS_MODULE += --be8 > > endif > > > > ifeq ($(CONFIG_ARM_MODULE_PLTS),y) > > -LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds > > +KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds > > endif > > > > OBJCOPYFLAGS :=-O binary -R .comment -S > > -- > > 1.7.12.4 > > -- > RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up > according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: wladislav.wiebe@nokia.com (Wiebe, Wladislav (Nokia - DE/Ulm)) Date: Fri, 2 Sep 2016 12:02:43 +0000 Subject: [PATCH] ARM: fix linker call for ARM_MODULE_PLTS In-Reply-To: <20160902092450.GB1041@n2100.armlinux.org.uk> References: <20160902092450.GB1041@n2100.armlinux.org.uk> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > From: Russell King - ARM Linux [mailto:linux at armlinux.org.uk] > Sent: Friday, September 02, 2016 11:25 AM > > On Fri, Sep 02, 2016 at 09:17:58AM +0000, Wiebe, Wladislav (Nokia - DE/Ulm) > wrote: > > module.lds script doesn't get called when > > CONFIG_ARM_MODULE_PLTS is enabled. > > Use KBUILD_LDFLAGS_MODULE to fix it. > > For those of us who haven't encountered this problem, could you include > some commentry in the commit message describing the failure mechanism > and why you think this is the correct solution? > > The final link for modules is: > > quiet_cmd_ld_ko_o = LD [M] $@ > cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \ > $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ > -o $@ $(filter-out FORCE,$^) > > which seems to always include both flags. Why is it ignored when it's > in LDFLAGS_MODULE? What about the other flags we pass in > LDFLAGS_MODULE? aah -- just found an issue in my environment where LDFLAGS_MODULE gets overwritten due to a none upstream patch on scripts/Makefile.modpost. It worked only for me when using the KBUILD_LDFLAGS_MODULE and I did not get deep inside after I saw in https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt +++++ KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options used when linking modules. This is often a linker script. From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). +++++ and found that all other architectures are also users of KBUILD_LDFLAGS_MODULE for that purpose $ git grep LDFLAGS_MODULE arch/ arch/arm/Makefile:LDFLAGS_MODULE += --be8 arch/arm/Makefile:LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds arch/arm64/Makefile:KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds arch/hexagon/Makefile:# LDFLAGS_MODULE += -shared arch/ia64/Makefile:KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds arch/m68k/Makefile:KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds arch/powerpc/Makefile:KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o arch/powerpc/Makefile: KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ Anyway, feel free to ignore this patch and thanks a lot for the fast feedback. > > Thanks. > > > > > Signed-off-by: Wladislav Wiebe > > --- > > arch/arm/Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > > index 61f6ccc..01c6025 100644 > > --- a/arch/arm/Makefile > > +++ b/arch/arm/Makefile > > @@ -20,7 +20,7 @@ LDFLAGS_MODULE += --be8 > > endif > > > > ifeq ($(CONFIG_ARM_MODULE_PLTS),y) > > -LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds > > +KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds > > endif > > > > OBJCOPYFLAGS :=-O binary -R .comment -S > > -- > > 1.7.12.4 > > -- > RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up > according to speedtest.net.