Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1725549rdh; Tue, 26 Sep 2023 01:18:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiEeHbs07vesbGzQRUJ0aPEpphEuXS0DL4k3ONXf3NC4Ih71wyPB2kISMHwUWA+HSGrgWH X-Received: by 2002:a17:90a:c70f:b0:276:78f2:5d31 with SMTP id o15-20020a17090ac70f00b0027678f25d31mr2826330pjt.21.1695716288319; Tue, 26 Sep 2023 01:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695716288; cv=none; d=google.com; s=arc-20160816; b=kwY4WkXj4rHKa29Dd9jPZzxJyA7GSoRbuJY95PQNIvqTLgVMkTl6fSkGXWshFJeHqv PrBFjjg5aIMyXlauvNxe4cZPPw2kZ/xau9jMKPsp/eszvjWt9wmZ+WPQ7pB894CMBZOp +enSEErdGRjaqwfaoeUuJvlZ7QybO4um4myua/p0f7+PeXb0cVOtXAEHXjD5t5GXf3On 6SYAlImfDl9W/Fkhw7o2WyQ3rfIxLAPBbEnoxBbfJJHYUUVWgcwCPQVru2cyqku5DQAm x94npW7JGztlKkzg3/6cmuupAxzYqV66vTPp54/miUIxXUR8MQzdd+GtnlPeFPNm9Wo7 CUUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=fX6M7HvwkJYwwG6lya+hYdJvRlzL8HUwKsNMoPkciww=; fh=NSlpVmp9/EqeSZuKfEjg6u7FbKTTBBKQRa+lb1eLM7c=; b=JBEOpMPhWOPwxBr5czQUyECwnvTumrSV66dkjhG2KDdtxNGApZfZiK9ggEeL/PPfaD yYqQPV2AGEXsmMdmjznCNWUDnc9wpiJWJmVIzGtLvMNtuOy0Yxf4AHWaZwOqPGakinpU DrnRnqk9uOF8dl0XTL9bBRWbsG+YuOhOnNMHaSx/YP9iPXke7XuJ4/X/btx8iSNhfEel rUeZIolRvf1LymD53tAdVrt0/wOXH4QY5Ik2z3Lnor5wWv2SpwO9UHCFwLIUqNxjHTys S+RgormmkD8S9PF88ymjwqZ+7k4SidndgQ5Lo8XU0wAifSkikRwT+kKQDPKK3a86bm88 wXZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id f20-20020a17090aa79400b0025c1d114af0si11755911pjq.93.2023.09.26.01.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 01:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D51158075299; Tue, 26 Sep 2023 01:11:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233875AbjIZILT (ORCPT + 99 others); Tue, 26 Sep 2023 04:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233864AbjIZILL (ORCPT ); Tue, 26 Sep 2023 04:11:11 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5C48110A for ; Tue, 26 Sep 2023 01:11:02 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxyeoSkhJlRZUsAA--.10334S3; Tue, 26 Sep 2023 16:10:58 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxni8NkhJlnnoSAA--.37906S3; Tue, 26 Sep 2023 16:10:56 +0800 (CST) From: Tiezhu Yang To: Huacai Chen Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH v1 1/3] LoongArch: Define relocation types added in ABI v2.10 Date: Tue, 26 Sep 2023 16:10:50 +0800 Message-Id: <1695715852-15902-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1695715852-15902-1-git-send-email-yangtiezhu@loongson.cn> References: <1695715852-15902-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8Bxni8NkhJlnnoSAA--.37906S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW7Ary5Jw45trWUWFWxWr4fCrX_yoW8ArWUpr yDZr1DAr48GFn7ua48t3WkuF17XrykK3y2qa45WFyxCFsrX348Ar18Wrn8ZFWUWwsYgr1F grn3uw18XFZxJwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU9Yb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2kKe7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07 AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWU AVWUtwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7V AKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v2 6r1Y6r17MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17 CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF 0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIx AIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIev Ja73UjIFyTuYvjxU466zUUUUU X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 01:11:24 -0700 (PDT) The relocation types from 101 to 109 are used by GNU binutils >= 2.41, add their definitions to use them in later patches. Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=include/elf/loongarch.h#l230 Signed-off-by: Tiezhu Yang Cc: --- arch/loongarch/include/asm/elf.h | 9 +++++++++ arch/loongarch/kernel/module.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/elf.h b/arch/loongarch/include/asm/elf.h index 7af0ceb..b9a4ab5 100644 --- a/arch/loongarch/include/asm/elf.h +++ b/arch/loongarch/include/asm/elf.h @@ -111,6 +111,15 @@ #define R_LARCH_TLS_GD_HI20 98 #define R_LARCH_32_PCREL 99 #define R_LARCH_RELAX 100 +#define R_LARCH_DELETE 101 +#define R_LARCH_ALIGN 102 +#define R_LARCH_PCREL20_S2 103 +#define R_LARCH_CFA 104 +#define R_LARCH_ADD6 105 +#define R_LARCH_SUB6 106 +#define R_LARCH_ADD_ULEB128 107 +#define R_LARCH_SUB_ULEB128 108 +#define R_LARCH_64_PCREL 109 #ifndef ELF_ARCH diff --git a/arch/loongarch/kernel/module.c b/arch/loongarch/kernel/module.c index b8b8608..c3f9d2f 100644 --- a/arch/loongarch/kernel/module.c +++ b/arch/loongarch/kernel/module.c @@ -382,7 +382,7 @@ typedef int (*reloc_rela_handler)(struct module *mod, u32 *location, Elf_Addr v, /* The handlers for known reloc types */ static reloc_rela_handler reloc_rela_handlers[] = { - [R_LARCH_NONE ... R_LARCH_RELAX] = apply_r_larch_error, + [R_LARCH_NONE ... R_LARCH_64_PCREL] = apply_r_larch_error, [R_LARCH_NONE] = apply_r_larch_none, [R_LARCH_32] = apply_r_larch_32, -- 2.1.0