Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp818294imu; Tue, 11 Dec 2018 08:03:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/VM/4/b4tNPhd9PLioIqZ1yrwOVW1g+c4dOI9HXC28IlIvO3FneB0w7h8PwgUiXaA2QRwZR X-Received: by 2002:a62:345:: with SMTP id 66mr16723692pfd.189.1544544225239; Tue, 11 Dec 2018 08:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544544225; cv=none; d=google.com; s=arc-20160816; b=yv+Rw93FBCrwDU2NZ/rUk1QZp1L9HEFNI7Sn3zqwT8M0t1QtY5SE0uJfAn8RS1Rj+/ l6iC9rYDhhgDHmcvdlnR0z0yDRBlZmw+V3HFMWj4dLWuyn/oQSLa75G00Q+gBZAFhXxP t9XmORBXL6p3Wod3fyA4W9OI4c5vfxOGfZT+swObNHttYfmooSm/PbcxX9Q+VNQbTcfb qMdKrymIY450oxfoDaJ/Yvo1nXT2/vrC4Oe3T4/BXlIOTibbeS0l/WCFK88Ao3LEo+3r RUv4Lp6XTnudMP/W4lFng6gAMr058DOGcuEz8iXhP8uBxkiwmkAZUhOGozrvInUcDAnu uJ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n8NlNyPbiatzYOVa+rjgoEZIVuf5lAcVmhOUUUGHCkE=; b=OJKulJ67XV0nUN9ZzQnK1UD4CCm3bDCPIIT0w+SKrfAGT5vIs/b4ZNpsiI3hTlxuZ4 uyJQipsukl2Mrx2/6RJdTRK5WXV8Vp5qAhCAk4CRZ1TeEWqHGJfNZWxfZzvcq9IbmSih pOGLxnz19XiqbrfR3MtO7d20qneRDYNH2xXLvkNYhZWI1+aLntP+StcKjhsW3IjrTdpt 91nDKwZYTd9o1BXToO6MKPWmT5YI3zc5HFZPjlsa/XnoW+UDZf3eZSXqjFqC2HY9hw0+ ybqgDHYRDxu92Cux7p/LUxaP6onQ2JcA/V/hsmRShtgHttcUIA3nu4npcDyhEEIjQhu2 xcvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HWpQB4O2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si13085659pgh.58.2018.12.11.08.03.30; Tue, 11 Dec 2018 08:03:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HWpQB4O2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730715AbeLKQAi (ORCPT + 99 others); Tue, 11 Dec 2018 11:00:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:47352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730967AbeLKP6K (ORCPT ); Tue, 11 Dec 2018 10:58:10 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 347272145D; Tue, 11 Dec 2018 15:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543889; bh=ufXmbXQFReG4SVo9pv+qVihlTvYvdxYF71vXa3zcTvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HWpQB4O2FzoaNJmwQbI/v2r0P4OpqK8lnoi1btRCOTGJGemoV2tqynmmTNfvnkMwd nG/ZTZO4xt/2afK2eYfkTi6WElyiiuGf0hjDNrDGIOcQpb8PEx4+DlzkGgyLF+bol1 l0+XYpWtT46YEjwC8rX3QmhEyjEoZJINDVPAhDfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Frank Scheiner , Helge Deller Subject: [PATCH 4.19 076/118] parisc: Enable -ffunction-sections for modules on 32-bit kernel Date: Tue, 11 Dec 2018 16:41:35 +0100 Message-Id: <20181211151647.324119111@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151644.216668863@linuxfoundation.org> References: <20181211151644.216668863@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Helge Deller commit 1e8249b8a4e960018e4baca6b523b8a4500af600 upstream. Frank Schreiner reported, that since kernel 4.18 he faces sysfs-warnings when loading modules on a 32-bit kernel. Here is one such example: sysfs: cannot create duplicate filename '/module/nfs/sections/.text' CPU: 0 PID: 98 Comm: modprobe Not tainted 4.18.0-2-parisc #1 Debian 4.18.10-2 Backtrace: [<1017ce2c>] show_stack+0x3c/0x50 [<107a7210>] dump_stack+0x28/0x38 [<103f900c>] sysfs_warn_dup+0x88/0xac [<103f8b1c>] sysfs_add_file_mode_ns+0x164/0x1d0 [<103f9e70>] internal_create_group+0x11c/0x304 [<103fa0a0>] sysfs_create_group+0x48/0x60 [<1022abe8>] load_module.constprop.35+0x1f9c/0x23b8 [<1022b278>] sys_finit_module+0xd0/0x11c [<101831dc>] syscall_exit+0x0/0x14 This warning gets triggered by the fact, that due to commit 24b6c22504a2 ("parisc: Build kernel without -ffunction-sections") we now get multiple .text sections in the kernel modules for which sysfs_create_group() can't create multiple virtual files. This patch works around the problem by re-enabling the -ffunction-sections compiler option for modules, while keeping it disabled for the non-module kernel code. Reported-by: Frank Scheiner Fixes: 24b6c22504a2 ("parisc: Build kernel without -ffunction-sections") Cc: # v4.18+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- arch/parisc/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -71,6 +71,13 @@ ifdef CONFIG_MLONGCALLS KBUILD_CFLAGS_KERNEL += -mlong-calls endif +# Without this, "ld -r" results in .text sections that are too big (> 0x40000) +# for branches to reach stubs. And multiple .text sections trigger a warning +# when creating the sysfs module information section. +ifndef CONFIG_64BIT +KBUILD_CFLAGS_MODULE += -ffunction-sections +endif + # select which processor to optimise for cflags-$(CONFIG_PA7000) += -march=1.1 -mschedule=7100 cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200