Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34853644rwd; Sun, 9 Jul 2023 22:04:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlEk9rERAnBDslHkyOYh3dvZGGgEiDhOXWJe4vR7SuBjRsARnko4hUv7V30R+bDxvYddQMCr X-Received: by 2002:a05:620a:3914:b0:75b:23a0:deb7 with SMTP id qr20-20020a05620a391400b0075b23a0deb7mr12120795qkn.53.1688965477530; Sun, 09 Jul 2023 22:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688965477; cv=none; d=google.com; s=arc-20160816; b=ue1ktVTROMDEoYTJICOVvnd1jns2k15y8SsVVP4pHOnnEkRhIgwZKVUhZpyeFW/Y+N UIdABc+RsMYzmP/vs8lMx0AIZ9PB07hSaFUYrCPNzDdDOLPtMI3QFeQ6lVNILRppGORv babtbps6BCTeIn3L1wIDLk3iHgxGH8k57lOWXxl7/PnTwQsmvD/DOAlq6qrVLXirLjXP OcYtyLvOvYYcxfDVqbShUky9WpJyubAEqf/98v2aKJUY5mOE7qcgd9NonX7TwTg7CV51 oH5XZKv06jeeRQm/WKr0V6eAaulA4iYjceI5XdZwOmjRQf1rhU+vZ+GWJhWS4VfDUHyk a/3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+pbksyCdhG/NghpMHpzEA9zv3CT/qAVe2+8gazdpjE4=; fh=M0S33IGknW5HMl/TVez3aVn0g6Btxl5Dt4RVvkHN+KE=; b=DN3NcU64UmqGAFRXp882g89KLKX8G8Fg9VYuinn439qkVbLrLizxBZ5mBLg5y9aeEj ksGlNcAJQsHHRK6FoqlyIZxHYkSPtOp9HWhRaqh9hKR6EwcxoFS+eIRqliqiCFQtdE7t 922uQv6JXEuyFsf6APiocMidptnYlmdXoP9oDMbh9mqMEjTI8EOj+mfD0wsy9cF2IZJ+ m98Vm5DmlKcQKG4yVJWjYQbwtSuH1WyQcMztkhtCmozEe832E8h/S7y3Dvjx0gCSqPa+ 2VUFQb26UutYb+wwwhHrA91iDlmZFyv4SOpjbAhNFOGV7iT1Ntp3V542dQP/Vd0Apax/ zQuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a170902a51200b001b8987f4004si7622332plq.541.2023.07.09.22.04.25; Sun, 09 Jul 2023 22:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbjGJEaZ (ORCPT + 99 others); Mon, 10 Jul 2023 00:30:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbjGJEaS (ORCPT ); Mon, 10 Jul 2023 00:30:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0EF010C7; Sun, 9 Jul 2023 21:29:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7681F60D54; Mon, 10 Jul 2023 04:29:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B9FFC433C9; Mon, 10 Jul 2023 04:29:49 +0000 (UTC) From: Huacai Chen To: Arnd Bergmann , Huacai Chen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Huacai Chen Subject: [PATCH] LoongArch: Fix module relocation error with binutils 2.41 Date: Mon, 10 Jul 2023 12:29:23 +0800 Message-Id: <20230710042924.2518198-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Binutils 2.41 enable linker relaxation by default, but kernel module loader doesn't support that, so disable it. Otherwise we get such an error when loading modules: "Unknown relocation type 102". Signed-off-by: Huacai Chen --- arch/loongarch/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index 09ba338a64de..7466d3b15db8 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -68,6 +68,8 @@ LDFLAGS_vmlinux += -static -n -nostdlib ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS cflags-y += $(call cc-option,-mexplicit-relocs) KBUILD_CFLAGS_KERNEL += $(call cc-option,-mdirect-extern-access) +KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) +KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) else cflags-y += $(call cc-option,-mno-explicit-relocs) KBUILD_AFLAGS_KERNEL += -Wa,-mla-global-with-pcrel -- 2.39.3