From patchwork Fri Nov 3 15:58:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1137664vqu; Fri, 3 Nov 2023 08:59:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZbwFjuJeJqcqoC7J+Lh4HgwrUkYj6fkQxGa9SH7AUp6eHJmfd3j9+JMpFaUOOzWI8GHnw X-Received: by 2002:a05:6358:6f1a:b0:169:4412:b6ef with SMTP id r26-20020a0563586f1a00b001694412b6efmr30456316rwn.7.1699027150798; Fri, 03 Nov 2023 08:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027150; cv=none; d=google.com; s=arc-20160816; b=ldxQG+NZxGuGRA46QwNIbTwVbO0z8CFWVbB/pqu8sZd5EvUTFAEsVho7I3R9bI4WfA xhaRyh5pYTCv6mB6QY9qRWiU1Gi9hp6W2FS+jSApFfaZrNm2QAry8FPc/ZayvzUI/3sE dW4koD3mFBp6drAgazoocYlvd/SOEsa/avOMxzknxzmccH/TNvMQExTuBB8Ps82hdlbK nUMfIwsuoHeerz3XPIf+PVry/v+fFLXwy+zT9+xZVotKhRTUxg7xW/DFkD4bSlua496H Q5k/zz0DKVvkhlTcBiVFR5O28Yt0H/GrSYCPi1R9uZxEC3LnuMA/khf+7+cAUAUgeaU9 RL1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=habd2PNn77ZADV9mcs8dwgbFVKyO7HK9xbC5yXA44+c=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=TspPBw+Z9wjsluj50kqAsjo1uPH1IyNMUmDEIJU0/huQ8qX9Myk53FsJyn/ivksO0/ DNzEovVlAD9QXqx/auZlo3Go1+dVukrCefvWPcf0b0urPSW/vLy34myz9Y5TD79k7b+B pWQnAXuV8M05WFRng9I1x65cdtOvTMPI81pW/u/u+MO7GGZrA1wfv/DbsfVjuJ4L/lMx tYEPHx2FLxOR6Xa+FvDq7vSUDKhQ6say/Jam/EXPhM7qzhBJ9VPytIwzKPcyklkLEuXY sKZqAvYkBkx7Mz1w12zgQXeztN0k4j3otFzfNvBF2uTHHMNwQ4khO40i9e/OtisZhIGo sN6A== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bz35-20020a056a02062300b005b97024487csi1802249pgb.315.2023.11.03.08.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 95FAB8219C24; Fri, 3 Nov 2023 08:59:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344176AbjKCP66 (ORCPT + 35 others); Fri, 3 Nov 2023 11:58:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234328AbjKCP64 (ORCPT ); Fri, 3 Nov 2023 11:58:56 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE78194; Fri, 3 Nov 2023 08:58:51 -0700 (PDT) X-QQ-mid: bizesmtp83t1699027115tqmp7mar Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 03 Nov 2023 23:58:32 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: 3M0okmaRx3gtg4dkowId3SRZK6iJt7bmG/bknUDKf+3ULUZKiHp/tkQ2jHTjZ qCAJtCYV+PBISnAzK2lTT9gQ93lFd4WLGlpACg09bFke2VMU51xGkofztcVkF64kLeB/I40 gt7AiMXFEF2xrMMx0HrXUSXv2jHoH+pff3Xms4oos9d5sxvTKIeoM4HgumgCEXWN1DXMZGG mOnRKFHyB0tdauEDaWiRCJ4WkEsUYt3jBksdkZqXTIOM4Sg1erJZuCIGNrgNzHJvUOE0TQI qfM8VoqG8AKNC9mj7MLM6aOKtJ7PJZrzG9XhTTXhE/GAatyk3aTKEWjcCrmwWhXqp/YBb1k Fal2Ut2duOE5o37lshvTGlRfYJ/VnEvHOdQu3tDN7OWkjvzEFMMskq1oA1G7g== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4824966276626844455 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 01/14] DCE/DSE: allow keep unique bounded sections Date: Fri, 3 Nov 2023 23:58:30 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 08:59:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559093477474070 X-GMAIL-MSGID: 1781559093477474070 From: Zhangjin Wu The bounded sections may break the elimination of some dead code. Some unused syscalls have been wrongly kept by `__ex_table`, we will unique `__ex_table` for every inserting and then remove the unused ones explicitly and eventually, the unused syscalls will be eliminated. In the future, we should find better methods to solve such issue: Some code may use '.pushsection/.popsection' to insert data to a bounded section, use `sys_sendfile` as an example: sys_sendfile: ".pushsection __ex_table,\"\"\n" ... ".long ((" insn ") - .)\n" ... ".popsection" `insn` is an address in `sys_sendfile`, even if no real user uses sys_sendfile, the keeping of __ex_table will become a 'user' and break the elimination of `sys_sendfile`. All of the bounded sections should be uniqued, and we should check if they are the last users of the code, if so, those sections should be removed and the code should be eliminated. Signed-off-by: Zhangjin Wu --- include/asm-generic/vmlinux.lds.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 9c59409104f6..ea8170e11ab1 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -103,6 +103,7 @@ #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral* #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]* +#define BSEC_MAIN(sec) sec sec##.[0-9a-zA-Z_]* #else #define TEXT_MAIN .text #define DATA_MAIN .data @@ -110,6 +111,7 @@ #define RODATA_MAIN .rodata #define BSS_MAIN .bss #define SBSS_MAIN .sbss +#define BSEC_MAIN(sec) sec #endif /* @@ -201,12 +203,12 @@ #define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ _BEGIN_##_label_ = .; \ - KEEP(*(_sec_)) \ + KEEP(*(BSEC_MAIN(_sec_))) \ _END_##_label_ = .; #define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ _label_##_BEGIN_ = .; \ - KEEP(*(_sec_)) \ + KEEP(*(BSEC_MAIN(_sec_))) \ _label_##_END_ = .; #define BOUNDED_SECTION_BY(_sec_, _label_) \ From patchwork Fri Nov 3 15:58:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1137859vqu; Fri, 3 Nov 2023 08:59:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGW50id0L2na0cMT26Fx5xtJprEhlMvZoP0tkuro7pfnOs5xFkMTQ5XSpvTOzrBZNU4ZVk+ X-Received: by 2002:a17:902:bd05:b0:1c9:b207:d412 with SMTP id p5-20020a170902bd0500b001c9b207d412mr19532854pls.37.1699027169465; Fri, 03 Nov 2023 08:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027169; cv=none; d=google.com; s=arc-20160816; b=eGsgPEKKK8dQT2WAAyKiBegS7oekfTWwzTNtLAyGO6LNQVc1MQOfdrUYS96DkhQs3k 6lnlVU7R7art2ueEd2MXzr/kmI9qRJw453MsaZ71XV2/kHQbCPfhbZTnuden1MFb27qX 3++e8uzXBAhR4dn8fR/zlhSzDG1Ml1uF8jLUer+D5gOlJGkf/1JxGdonLo/pBFq46qbk DAu1U5gjdtr7ONC99t5YJk7JHy/n4azO0TAHzgNn48mEhtlz4YkmII+Hyz5ilh8caKrx N6wezPCmyBfBJscMi9NZ2OzuUarpdiqxI6t58gLVEB4LSSzDTEksHoO+KC0qsDvOs3Et J2ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=WTaUHo75fFE+jMIAh5g2yEyp9VcKdSEEwPVeitydaPI=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=v1bOQadtLo1q69pJu44O9SwGwXTOwacMzhqwxWTSHSHzcem6NiwrWaZJbwgS9hi/9p xAYfIf4wsiDGro+e+fAhdsvcI+PcldsLLtQBku4k1TzP0Nkpa6ZEgfl2u7Ll2tcS/GIB AzIm/tPFi8pQI7ARCZI+loIPOFyWy0CFB4TOaZtab+aTN4+Zfe2AJOYLudrtI6dgJxPL jkIPetHX8hubzakosqrFGx/EkLJ5Du/62vEfAjaV6XzZfOeVIEnQ7V+L9PIT4IwHWJF3 43xmUDuKaRS4C10UaK9hH91Q2NOCEbIkYZqrDLSiqCTWOULhPncQJDoQBw+TtUJy+dmn W5dg== 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:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n9-20020a170902d2c900b001cc30c11197si1795285plc.344.2023.11.03.08.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:59:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id DB84F80E4A03; Fri, 3 Nov 2023 08:59:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344318AbjKCP7P (ORCPT + 35 others); Fri, 3 Nov 2023 11:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344362AbjKCP7N (ORCPT ); Fri, 3 Nov 2023 11:59:13 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 273A5D4E; Fri, 3 Nov 2023 08:59:08 -0700 (PDT) X-QQ-mid: bizesmtp86t1699027134tyw2b1v4 Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 03 Nov 2023 23:58:50 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: eSZ1CZgv+JCVHfF1wGxh8nF1q0geFQVjdp7+4eC2s5jBRXYvF4MCh5LGR7B+E 8+fmWyYidCbzrgu0MyIjfriJ59BganbsFbgX/5YcVpNzFbubzZ6dLiMjHahc457QS0HWkpM Fs+rI0pdcMyYCTK4SUwz0pMd3PBl01wPTUvQesEcQq+EJG/XuR2vXuTHrlODVWPty+yV/29 2Vnc8zaKv9YE6DbotW/r8+csDUkR1pa5ZtDVaUUN5+YVN0eCeGjKznkQB0jsEaGSMDKdrln 4vKFNLZIoLjH5UocAwhtcmVuhVONXyw1aSP1/0oQeB7WlrjtTw1rgFghaFSj/mHgl+ZkWO2 yA9Fx5mYFZAXRB61jZpB7Sq3gDPes8pPxQZSZMLehfXO4a96th3jTtVgpf52ywStnBsM5Uq X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9783515542256517097 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 02/14] compiler: add a global __QUITE_UNIQUE_ID() Date: Fri, 3 Nov 2023 23:58:49 +0800 Message-Id: <152d812cb6fa2c6018794ea7f05f487631542d6e.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 08:59:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559113537326288 X-GMAIL-MSGID: 1781559113537326288 From: Zhangjin Wu Differs from __UNIQUE_ID(), __QUITE_UNIQUE_ID() also appends the __COUNTER__ info to make it more unique. Besides, seems assembly code also require such a unique id, let's make it global, the same to the required __PASTE macro. Signed-off-by: Zhangjin Wu --- I am not sure whether it is proper to put the __QUITE_UNIQUE_ID and other stuff later in compiler.h. Welcome discussion as this is just a preliminary approach. include/linux/compiler.h | 5 +++++ include/linux/compiler_types.h | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index d7779a18b24f..405b19cf6cf3 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -227,6 +227,11 @@ static inline void *offset_to_ptr(const int *off) #endif /* __ASSEMBLY__ */ +/* Quite-unique ID. */ +#ifndef __QUITE_UNIQUE_ID +# define __QUITE_UNIQUE_ID(prefix) __PASTE(__PASTE(prefix, __LINE__), __COUNTER__) +#endif + /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index c523c6683789..0b79e19d1017 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -70,10 +70,6 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { } # define __builtin_warning(x, y...) (1) #endif /* __CHECKER__ */ -/* Indirect macros required for expanded argument pasting, eg. __LINE__. */ -#define ___PASTE(a,b) a##b -#define __PASTE(a,b) ___PASTE(a,b) - #ifdef __KERNEL__ /* Attributes */ @@ -308,6 +304,10 @@ struct ftrace_likely_data { #endif /* __ASSEMBLY__ */ +/* Indirect macros required for expanded argument pasting, eg. __LINE__. */ +#define ___PASTE(a, b) a##b +#define __PASTE(a, b) ___PASTE(a, b) + /* * The below symbols may be defined for one or more, but not ALL, of the above * compilers. We don't consider that to be an error, so set them to nothing. From patchwork Fri Nov 3 15:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1137843vqu; Fri, 3 Nov 2023 08:59:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8Rz2PLj5ZcD0pT5Elh9GTestfJNV6VDk7C094You//8/O/N0i9jE/s3T5TCxz6DyIn85l X-Received: by 2002:aca:1705:0:b0:3b2:e12e:d2db with SMTP id j5-20020aca1705000000b003b2e12ed2dbmr23700148oii.39.1699027168226; Fri, 03 Nov 2023 08:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027168; cv=none; d=google.com; s=arc-20160816; b=Xf6wg6rjXl9tevcwoQKy0ifJdgx/maruLAomjnAuamDlxZExWxbMdgejYflsvIDOYh 5QWwTnHKCuJYyHUJo8MOW52JB+RirA2MqBGpkld4D5TizmnaMUAt9T4SicXj2g6ihxuQ PqUm1kBqTbCxMsL/VzXZWd/XBMsEoHIyzzjCqin66zUeb9V/Snf9C9l+6Q2rF7FHLJFM bKuLleWq9OFbHmWirWK02dwr1oYkWlCv/hLyHifYMad1QzZQ9F5lE22bwTqxoSHrpRJj 5cDAiPCDdxVqHJr7JP0AI+8EMbbDzqyCvWC8dDplXC694KCGQ4sivY92Bu7rM40LWPPO 5fPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=wBvMquVlqkpWEA6y6cYzf5eyErtSgM6WKlT76e6tEtQ=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=B4YvovuIWZSpXqUrClPpjf7+fTjAKb68vCwNo/PqKWSI0Uf1spLEBz0E1pceQ2F4gQ wwHfNumana6C9MsQXSg2g/Irjz0kbeed4uEV3Fz9PSjIayJSGrpBIyBPbA+pPWEjQFG7 bRoysrIJOAfe7RFPMMuyCMhFeLecZEJri3f+MVUp9MFXObKToigdk+mxWmNw54YTnJcw wL1gu1jv603JvdVn1d9DKPtdMAeE6XtMcKfLiDFC+/whFT0nJOUyMofpcDZUNvffv+GI GShgnicaQvM+PY7GzxyQxJhRNdIChyJJY6mmUX4gohkHbpdH6H/f7C+OjiXiEPK3who4 OUtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fh27-20020a056a00391b00b0069347c30c78si1704498pfb.230.2023.11.03.08.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 6A34083C1E00; Fri, 3 Nov 2023 08:59:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344660AbjKCP7V (ORCPT + 35 others); Fri, 3 Nov 2023 11:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344558AbjKCP7U (ORCPT ); Fri, 3 Nov 2023 11:59:20 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E5C9D4F; Fri, 3 Nov 2023 08:59:17 -0700 (PDT) X-QQ-mid: bizesmtp87t1699027144tuxhh48b Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 03 Nov 2023 23:59:01 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: LE7C6P2vL8TDvuFtQgm7U5nmg5IefRLiYgMU7BisqY8a+MfFY5YFw57t6eU2N mHG9XUzklv0HbI1UYbnludIhogZCI7W/IazcZj+b/17hSpDlk9STyb/1qy8aOE2wUbOzCOZ EJn/pf7LRNuuDgsl1ei03i4F64rI0B4WYb761k/inK0WMo/2LPTxfduiL64kC54tN2qYj6t hSep7h9sssI09uh7yXGRmhB/6Z75f2XrvS/dhZRHxDT6hhxRWQRSbLi4gjCZaegiLml9nXo uSCfn4EBkxIyImAQMxNPNtmyG7cYWqYRM00FNDOSz631ECpoP+OjLEe1sXE5O7xcvql3Riv 8CaSaqWCZoYQNtMBmJ3hnYreg2Te9iyb3F76nRBVtDUVxQ8ajDjjBSD9mAMXg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6960832744754887515 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 03/14] compiler: add unique __SECTION_NAME() Date: Fri, 3 Nov 2023 23:58:59 +0800 Message-Id: <3c10b123c7ec27fbd942dd9a07d877743616c935.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 08:59:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559111769018319 X-GMAIL-MSGID: 1781559111769018319 From: Zhangjin Wu The new section helper is added for LD_DEAD_CODE_DATA_ELIMINATION to generate unique section name (strigified). Signed-off-by: Zhangjin Wu Signed-off-by: Yuan Tan --- include/linux/compiler.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 405b19cf6cf3..5a9cc3209b12 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -227,11 +227,25 @@ static inline void *offset_to_ptr(const int *off) #endif /* __ASSEMBLY__ */ +/* Import __stringify. */ +#ifndef __stringify +#include +#endif + /* Quite-unique ID. */ #ifndef __QUITE_UNIQUE_ID # define __QUITE_UNIQUE_ID(prefix) __PASTE(__PASTE(prefix, __LINE__), __COUNTER__) #endif +/* Quite-unique Section NAME. */ +#ifndef __SECTION_NAME +#ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +# define __SECTION_NAME(prefix) __stringify(__QUITE_UNIQUE_ID(prefix.)) +#else +# define __SECTION_NAME(prefix) __stringify(prefix) +#endif +#endif + /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) From patchwork Fri Nov 3 15:59:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1138004vqu; Fri, 3 Nov 2023 08:59:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHh0H7OJjH2S2zIBYv3EPczov6/czGCWGtcDT3GRU9+B6zI35H8M7ZliC/QCNboOmQN/EmG X-Received: by 2002:a05:6a21:47c6:b0:180:edee:151e with SMTP id as6-20020a056a2147c600b00180edee151emr11837363pzc.22.1699027184548; Fri, 03 Nov 2023 08:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027184; cv=none; d=google.com; s=arc-20160816; b=TkAVJADlFig8ML9zw0D7PXG1ZD8cxfHRLMPx0DBO/QAqoShv0xgwD6jBHIZyHAwFpS Mn6By6aifWLhjd4fEf3Gg25YBC9uSwu/3vK8Z9mZAEi/copKL5SG4u2YUZ6gZXxl0jLe Bj6+L0mgDtSEFSJkfFAJoHrxcQYNn/w2s9WNjoCtlUS6JRzsxJW1Kwi/O2z+hRaGyPUN hTpK29p4J5SRwYRPu5G8p//S20ZIIc2iLAkk2rON42fXf2FYEKZt1Zjm4NoXs38GM2Y0 jU+wusO4bIUgtNng+gUsIv0UoUOlQEKFJrWT2usku9TkiiWhanU6qqHfO3XrTcg2ej/n BUxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Lr0m96YeDDnRICrO7RC5qP0pqUNR/4JctHbSmAUFYHQ=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=YvnVnxWdqeirnu5Vl4PVxYmSBwHyk1wCvJoh1mK9xvhfPOXlnuZFBxhTOBArtvOKXb RtmG0kZI2kTxzKDcEgTFsn5yB4VH0wusc7AZ24iYOiVHyi22nE4us9X4xOZWBaruaS+n WdXULyLnvpoOtdDmeaU/VAEpQI45pq1DGVaWXWKuqe0ISEQpQC+ZUYd/wkysGYxL58M6 Di31jrjVLDmg83G0ZiLoZkAzv/Wuy0aoMonDtivcXg0l1yMF9Le0eqMCAFALtZ26BX6q DW5vm4jMvC+YTWwcmidjo/fxH9ocUhXLCrIPGe55968pDIbXaLiXGAhLwrzqb7qI1/wp xzbg== 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:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o5-20020a17090ad24500b002808736e2b3si1887355pjw.142.2023.11.03.08.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 4191D80E4A0A; Fri, 3 Nov 2023 08:59:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344472AbjKCP7g (ORCPT + 35 others); Fri, 3 Nov 2023 11:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344505AbjKCP7e (ORCPT ); Fri, 3 Nov 2023 11:59:34 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39327D5F; Fri, 3 Nov 2023 08:59:29 -0700 (PDT) X-QQ-mid: bizesmtp64t1699027156tvs9nek9 Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 03 Nov 2023 23:59:13 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: znfcQSa1hKbGuZsoOVNlc1WvbvEkFGnTx1nx7spI6Tuzd0sHLnkw7AiMgni3t ZggaII50uNhW4y9QfvuvOyeS4F6auFyNTJw8NQCg+vLjRI5V2SC6LCN9adAn0v67sJ3OSX/ ApylcxyFajCfrERC+YlFJVy8SGFJrBzCX2pVZ4xg8IbilwZDlWfF607cx65tZkc/N5v0pBo 5KJ44BzBG+chXyP6BguFE6wzB2WGXdJq47gbtwJbgnW6dVctfCnU818SNsx7tWsczxLqyqh u4yC+u7f5c5hMGNKdyDBqUc2ZmUsHeTUO2gp5wzAo1jI1qkf08kTw9ItQQe6yQ05zfvbyXV s7UC4ZqDN0fbnt0BzlvuczseCniFWDH+IfzMMqsezOL6Jc3njt6dIop1FXbag== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 3788500215190827511 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 04/14] compiler: add unique LABEL_NAME() Date: Fri, 3 Nov 2023 23:59:11 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 08:59:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559129076834371 X-GMAIL-MSGID: 1781559129076834371 From: Zhangjin Wu unique LABEL is required by SHF_LINK_ORDER support. Signed-off-by: Zhangjin Wu --- include/linux/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5a9cc3209b12..b178f5d51ad6 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -246,6 +246,12 @@ static inline void *offset_to_ptr(const int *off) #endif #endif +/* Unique Label NAME. */ +/* Label is file scope, __LINE__ is enough, and not change in the same macro call */ +#ifndef __LABEL_NAME +# define __LABEL_NAME(prefix) __stringify(__PASTE(__PASTE(prefix, _), __LINE__)) +#endif + /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) From patchwork Fri Nov 3 15:59:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1138769vqu; Fri, 3 Nov 2023 09:00:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMPeHFwJmQ+Cel0ou+9YLJ2ObG1zgOzv6XloXk8vXDPkrVHyG5vt0UWDcHORWpdrOR6N+y X-Received: by 2002:a05:6808:2022:b0:3b2:f344:3a41 with SMTP id q34-20020a056808202200b003b2f3443a41mr1639809oiw.2.1699027233166; Fri, 03 Nov 2023 09:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027233; cv=none; d=google.com; s=arc-20160816; b=Hw7S4/eh98EY/MXz1YrWJSqnc7OCARq9VBRgVmA9ofa0cKXWOLAZey00kKl8gk3I1X KraTEylwEB6KZFAA0bFV8xcWJ3FSPxrr2JlrawbboMFNkkEUtUxygHYsHHP3IbGDmilV ez0LfA6V2clFVF5StJ0pWJ/JDfFWdUu389d/mt2lp0scWGsDXrcJkBmUeqiNjLlDv03h pC4jwPFjTrk5/2Oi7nNshsEFQIRNAnSd9T3JiSuSk7U+BlBc/B47Za0o5TRpV2u9yOos /b7CQUaVKK3Ja7vCAE68n90Bh7xGnCXYRWd3a/IDsCBBJBQJJCc8dpNSoyysFX3dp3wI w/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=EO59TVlnXsGnPGwId0kb+bejgSG0E0LwxwIDmtXz/hI=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=Nma53yYulNhsB/f6W8RzZVDB6PGH+HEufpxjfmdL9fjuQhanP8VA2MpoC7Ht9Ue0ty 4RXhAVAXWA6cW7j4Y8OkjZ22YiAeVAISMuK6iylxlW0Gjntzs1HagA+PF90axg9jkdFU t9ryxZYktoJ4feAtKCJ6K7Ddh5Bt6928SCCMu9Ducj2ki/eZL3A1niq0P8bXX4WyPUmS tvcyFFrA1sLWvTs+xCGTAZUw5aVHStMy/ixJx77Dg5AbvtbZjSrMKEAlGZrdvO1Thy5B JdhKYzlv+47NJmO0cIpyQPq+Tu9JdqoLbJmKWVgyXVHNapWT81l742avu2ZK88A4Uxxr X3Yw== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a15-20020a05680802cf00b003af188ded42si721085oid.127.2023.11.03.09.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 187C482CC45E; Fri, 3 Nov 2023 09:00:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344505AbjKCQAS (ORCPT + 35 others); Fri, 3 Nov 2023 12:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343945AbjKCQAQ (ORCPT ); Fri, 3 Nov 2023 12:00:16 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B9A2CA; Fri, 3 Nov 2023 09:00:12 -0700 (PDT) X-QQ-mid: bizesmtp89t1699027199tr6cexfv Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 03 Nov 2023 23:59:56 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: J5JfekO1WsiW/sSK9b0/2SRgOwgztbvJaqippsUrhkBT0nfPERe3CiBmcwtjz QpzvzTaAyarFENK22g18sd4WrJtroYvGBndfc+80wj7YD8GXTPFE63PYdZfssoaggn37JF1 CeT4asgR6uqXE743WuMFyc0x2/w6p5rmPS5RdVkWpq1wdgAirUOvzdxBnfp/BH/yVAOG+VK nuqwGFmYsfi5b7WwIDnPQEhZN6hZb6/eGcz4PwK7TFD10lDLnMuVyHe9WS6+GDJ8RvQ2t0+ CRr+zifxj6GjZOuv7Gm2iGWovRvgRTB53/KK2DBFh1siV3bXj3z8JS2Obvsu+/t7oibKU9q 0uW9Al7Boxi073MJVkzuvWKDvgsnA== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6517666058283072593 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 05/14] DCE/DSE: add HAVE_SECTION_SHF_LINK_ORDER_SUPPORT option Date: Fri, 3 Nov 2023 23:59:54 +0800 Message-Id: <141030de2b3d470251d1588b39cb041ec505d84f.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 09:00:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559179993354358 X-GMAIL-MSGID: 1781559179993354358 SHF_LINK_ORDER requires ld >= 2.35. LLD supports SHF_LINK_ORDER to, but it does not support riscv HAVE_LD_DEAD_CODE_DATA_ELIMINATION. Therefore, I haven't tested the minimum compatible version yet. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- init/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index aa648ce8bca1..1ef5b19918e5 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1462,6 +1462,11 @@ config HAVE_TRIM_UNUSED_SYSCALLS depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION default n +config HAVE_SECTION_SHF_LINK_ORDER_SUPPORT + bool + depends on AS_IS_GNU && AS_VERSION >= 23500 + default y + menuconfig EXPERT bool "Configure standard kernel features (expert users)" # Unhide debug options, to make the on-by-default options visible From patchwork Fri Nov 3 16:00:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1139226vqu; Fri, 3 Nov 2023 09:01:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnPVpX+VqoQvqjmOk6FN7ud41KKIjdNuLPOgorQtKBlnN/+Bq8ld0jmB/uRmqTA0aY1MrW X-Received: by 2002:a17:90a:c08d:b0:280:97c2:5db7 with SMTP id o13-20020a17090ac08d00b0028097c25db7mr11168594pjs.17.1699027260429; Fri, 03 Nov 2023 09:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027260; cv=none; d=google.com; s=arc-20160816; b=s2EnaoMc/AWlAnQ5tVyy3b1ZyK+5MnMDYGDGq2sJOZv0E6WC7F6TpzHVgI3K6dnC3z xrY91SVv+ZIOgMLThQoU4DRY0aWjOpdGLSUp6USy+4Dbz2h+8cH8KvqTCfndUCpPSKaO mZB4UF8hxcRjYBC9d7M5BZ67Vu/3hiVPmte64oI/PzCITjw1Ort0FmP75bTbDFjrbcyq c/ejCMXngqJkGCcza8l1ECk6M1BhzRMEpnqkZ5XdZZZvTBrzxZsYFOjPMnkJhgQZUe3W jkK9We9H8zEqXAtDc6zkFlKU1niAVmVs189Ev+mD2Z3EgxoyFa687c/Uoz9tmaS6xtrT 5Zbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=v3f5V3UzZx1u2tROxoK6jpV+g0ol0tuHDDJOavpab3U=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=sBPaAWlXeeipov75NsflfWsmH7xFdXRoE1B+9dwoHjXgXJp8txKvFEpjtCrcnBA2hs s3Y3yZJGKfKa1n2voBvaaBI+BdfydSf7Z6uxkl2XFACny42kabFtOP0C+DYRAbuBVS+O ey3C3s3lMDSKIrGWvNCguoDlRPJJub6PAH4sMYVIBoiXJcxweVZzy0TYc5SxcCpBaeGz 6H0SxT1MMhJpV5DVlP/fxZ+jwM63Fet3OkGK2Eogjs6RyIuUpbKu8MwINM/+1g0DwqXI eAtqGDJMKdBvmtPWZsEH1Cb6Un0x2ShsaxYEYx8kFkfYufPnf1QCPgq36KunWlzmnr0l FXhQ== 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 Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id i21-20020a17090acf9500b0027cf6bb27dfsi1908356pju.39.2023.11.03.09.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:01:00 -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 5B22F8316EFB; Fri, 3 Nov 2023 09:00:46 -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 S1344730AbjKCQAj (ORCPT + 35 others); Fri, 3 Nov 2023 12:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343945AbjKCQAh (ORCPT ); Fri, 3 Nov 2023 12:00:37 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 561331BF; Fri, 3 Nov 2023 09:00:33 -0700 (PDT) X-QQ-mid: bizesmtp87t1699027218tobnpga2 Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:00:15 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: +ynUkgUhZJkQaK3UoZkl8UFfBrmOfnK/yegytHp4rc1pb7b3un2ZnJljIAZmQ SyXnHa++l4m7fRjBIwpFo2yvoE/z+Ce3xG96JEz4TUS94+884spbt6QK0ijO0pys/0ZRtXT yTJ4KdwcAqHHm5OmVSBQkAf2mXr2BFgZ8g576cDxArslhY/NINryQd/xWCqsDWIMikhIK5H F80QRPBTraDKtfwcPifb2vihwGdJnwe9t6tWh5K+jA32jgVR2NAE3gNY43CdkZKiUzIK/a2 2z0Yjtc8JZajCom/XHmuU5CGRQIrP77qUPwshGoOPHCfrSCD//QjBQ3x/AqijADYI8wvpru bFuICpJ75TWkL/kTNaxMRL/UNMNcWL/Kyk4wkY2UyFKdKCjwzNjoUiJ1OI76g== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8486065313594138101 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 06/14] DCE/DSE: add HAVE_SECTION_SHF_GROUP_SUPPORT option Date: Sat, 4 Nov 2023 00:00:14 +0800 Message-Id: <04271c1f3a4c3d369310146faefc0d05144276e9.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Fri, 03 Nov 2023 09:00:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559208165123442 X-GMAIL-MSGID: 1781559208165123442 SHF_GROUP requires ld >= 2.36. LLD supports SHF_GROUP too, but it does not support riscv HAVE_LD_DEAD_CODE_DATA_ELIMINATION. Therefore, I haven't tested the minimum compatible version yet. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- init/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 1ef5b19918e5..4296c97cfc84 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1467,6 +1467,11 @@ config HAVE_SECTION_SHF_LINK_ORDER_SUPPORT depends on AS_IS_GNU && AS_VERSION >= 23500 default y +config HAVE_SECTION_SHF_GROUP_SUPPORT + bool + depends on AS_IS_GNU && AS_VERSION >= 23600 + default y + menuconfig EXPERT bool "Configure standard kernel features (expert users)" # Unhide debug options, to make the on-by-default options visible From patchwork Fri Nov 3 16:00:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1139480vqu; Fri, 3 Nov 2023 09:01:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtg5AD2saaDO1wMlKjlTEp5bY2r00l9+YXY05PmU9IfTJhF3+DuyJkOsenDqA59b1ielsV X-Received: by 2002:a05:6358:787:b0:169:9586:9192 with SMTP id n7-20020a056358078700b0016995869192mr9689304rwj.24.1699027274006; Fri, 03 Nov 2023 09:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027273; cv=none; d=google.com; s=arc-20160816; b=q76VeUW5ja9QetaTPC8YfUXt8ovar7xFTUc8ecdQRBlaKGnYM40ykVtSwBZnScrXfH KLqeajS1I4i6AtdmIgzeWOHFaDAeUrnJbdxn4vt1VvYlpoOPsA4sCaJYHRdyNY3U/9nx DapuYA8q7FpXVhQnZZZCenJmCq5hYIUdo9dmAFv6jGJ2N5Ksi4T+sGOXK8sCHzqUPrfW 5VH5GZ3Z4xcjA/0d8ACxYhMZfvdZdwI0An9Er/usZV++QtWUp0UjzzlLAh0PIxTMfwab jBWH17ou0sKevkqSVY1ZUP76I9/bmawq/MeeldPBt+NGKOwRlo3+vtSNPYbdZql7VCOO Jamg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=gvLWhEw7SM5dv7/sZHKu2/GD/RhwYg6D+UM1uydR/ZY=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=0Q0qKSq/tPyb97oE6C/zaKQA3d63Z/lwbvpaaZED0Jqq6JmWvke2UzJSwlJAYXoodY FSRlZdjYWSaZJJkepiB4n7duj9CAdSGDJrMYiOOKtYkdJqmc1+hKYVwPrE+rFTH1NcSp BPjzQklj0zXVzgWA1VJIBxzP+7FuOTHytNN9U2/XJnoIyHZPCiNA5X1H1VvK2dfdWZdc UXrMNuxS6nPxCbpEbV5GIrl/4Rn0atmrzZVo06CvIvlMjkRDgn6I1v6zUkUJ8E/qal+A NY1qpwu3Vr8pEb90R6gLUgs9MUuF6CdQJHa0Zdz2RUw7aKZ7OJVxCGOJ0XZ0G5Vj/b2G 91yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bz42-20020a056a02062a00b005b9a1494637si1844462pgb.317.2023.11.03.09.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:01:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 92824831748B; Fri, 3 Nov 2023 09:01:11 -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 S1344505AbjKCQAy (ORCPT + 35 others); Fri, 3 Nov 2023 12:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343945AbjKCQAw (ORCPT ); Fri, 3 Nov 2023 12:00:52 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DFF4191; Fri, 3 Nov 2023 09:00:49 -0700 (PDT) X-QQ-mid: bizesmtp64t1699027236t5ijv5ky Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:00:33 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: rZJGTgY0+YOXiDRtSv5jrBH+Ok8Gp19fhcj4KioUSMpuqQklo5ZZQc/JPJ8NP EtrPZ1izysnRKGJpccJps5x7PACRlaGOgqrbhQsoXPYIL0wptOzTr59TlmxVaci9hDwmWW3 p2AG5vAakwXzlGOvAVJVj+6geI4kiy35fnAl8Hxgjur7eOzsHK3fr/I5H8UeJZfgM66PbGn yeYjqTHLgymXpyzEuYFaXxOuqvZ/uCI5ZmMmOhTzMnqvs5W/vD7crDXrQQkhlJGtCD99gYw TlsX5JstKOh466iu7/6cBHsznx3S3ZdcSo34kwI/IMvXXT09A715opfHEEVuc05iI+uAU/L 64Ij+YmTR0MwCKVFG9rPTnOMLXFsQg6LeXI01q9jVrDUx/zPUETEnoZ/zd554YXkD/vc5qy X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8259172485907225114 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 07/14] DCE/DSE: add HAVE_SECTION_NO_KEEP_SUPPORT option Date: Sat, 4 Nov 2023 00:00:31 +0800 Message-Id: <494854689a6f6f91da151ae4bd9a7a6132092271.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Fri, 03 Nov 2023 09:01:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559223050302089 X-GMAIL-MSGID: 1781559223050302089 Once there's SECTION_SHF_LINK_ORDER_SUPPORT or SECTION_SHF_GROUP_SUPPORT, there won't be any orphan section and won't need KEEP() anymore. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- init/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 4296c97cfc84..9834dbb0ddae 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1462,6 +1462,11 @@ config HAVE_TRIM_UNUSED_SYSCALLS depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION default n +config HAVE_SECTION_NO_KEEP_SUPPORT + bool + depends on HAVE_SECTION_SHF_LINK_ORDER_SUPPORT || HAVE_SECTION_SHF_GROUP_SUPPORT + default y + config HAVE_SECTION_SHF_LINK_ORDER_SUPPORT bool depends on AS_IS_GNU && AS_VERSION >= 23500 From patchwork Fri Nov 3 16:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1140095vqu; Fri, 3 Nov 2023 09:01:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0rRYTw+PwSMLZkOXDmjOqEwbBmKKN6t2yq/MhBWycdQisEjzH00aWbn/LpPqs4HJ1QIGr X-Received: by 2002:a05:6a00:22d6:b0:68b:c562:da65 with SMTP id f22-20020a056a0022d600b0068bc562da65mr20000985pfj.26.1699027301893; Fri, 03 Nov 2023 09:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027301; cv=none; d=google.com; s=arc-20160816; b=0yUysSfnQuI9Do9rHCTJYUvlf6hfOZf4Bh6vD7VVcCvjDGNulhPkU9b/22Fdgz1/gD Q11W73QSQzHcfp0FrkZdvtPOC64jOcjWQk7A/Uvhmfsz8kgHUjAA54nsYsvLxhLCRu02 F6I4/lETtkNUs5SpWhGDd/Q9zYZmr/k/YX8NOrhIEEomuDSylXOIJ2X+1PQrSobjGATu IfZwKaqu8rRSdCFgO6hlhBdlevg3qS0Q1+0gNUlOzRZ+WeF1CJWY1drKBz/gqx13a3mq j2LI89OZtjM3esHQU/VoE2RO2qfpr28U0OFj4CvYDgj+oYIJsdoUfDeQer0LmZaGEaII iD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=TPvuVw2DYqJuJbgyetqpKTz8pbs2WtdVBPfkFP1qpLQ=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=rpJ7X07L5XAUV2uusvcMKHTx05UJzTUNoTJHLUnBvy45YWeTK/LW55enjX535GqhZX zgUjdu9p97fiEVyRg/MaoKFgPPQRs/R9TJgh4XU0UUHKJIO6BLU5dQ7AYXmBHFZkIfZ7 z0mFroFQUFqcNJf0BavIGSVnMFL0k314tx8VZxIfDESbnPfbDvnTox9+tHc9+u4Z1cam EpcxAiY7pQ3AypCzrTX+x/HUxL1iXUtWETaEov1hIbLjJxJi4DNIdPTTBoPPPEsx34vv Lfsiad0/V1QzOJnsKLxqoLtvhew/+mMexTVP33sqvgSRMpYWykKHZa94EZD7Je3yRF8N 7YZA== 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 Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id i75-20020a636d4e000000b005aa41728293si1727820pgc.318.2023.11.03.09.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:01:41 -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 B006A83174BB; Fri, 3 Nov 2023 09:01:37 -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 S1345068AbjKCQB3 (ORCPT + 35 others); Fri, 3 Nov 2023 12:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343945AbjKCQB1 (ORCPT ); Fri, 3 Nov 2023 12:01:27 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41CC1D4F; Fri, 3 Nov 2023 09:01:23 -0700 (PDT) X-QQ-mid: bizesmtp78t1699027266ta08iml2 Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:01:03 +0800 (CST) X-QQ-SSF: 01200000000000000000000A0000000 X-QQ-FEAT: QityeSR92A28ZPRtiE81G2IrXHWg2q27WIobMU1SAAzpzkyyfEB73YsFcjdDe bVIiFyAUAwy8zzKzjrseeMWj0rb6pexvSi+JMipbHYhQxpuclzEMg7X6cSFvfm0zUbuvUkH h53yUWwjypGaV/yCfz9llOfRSJAl345Te7BpmmwciccZriF1iTUIX3Acz0VVcqgLQLxij90 vmo9hUQ4XmPwLxfIwOPQoqiZRoQRMntdfHYmU86oxGlguDcOLX+hQcU1iiGjDNaJ56wmm5f d1CU19gnS85haVh9DhVlHm0SEjXqii66p+6zMkbYe99A6q5hm0RXrwcR0y5/I8ghUS3d/Qn 7FA36k1Kp5SCYysOg6IbHNlCGA9XQ9hupgoQtSoicunaxLd4PZDp6bU1S/y2A== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 17055644200842692498 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 08/14] DCE/DSE: add choice of methods to build reference for orphan sections Date: Sat, 4 Nov 2023 00:01:01 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Fri, 03 Nov 2023 09:01:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559251818652394 X-GMAIL-MSGID: 1781559251818652394 Due to .pushsection producing orphan sections, the kernel currently uses `KEEP()` in the linker script to address this issue. Here we purpose two methods to build reference for pushed section, SHF_LINK_ORDER method and SECTION_SHF_GROUP method. The binary files compiled using both methods turn out to be identical, and it doesn't produce any side effects. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- init/Kconfig | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 9834dbb0ddae..9599d2de44e8 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1740,6 +1740,56 @@ config USED_SYSCALLS If unsure, please disable TRIM_UNUSED_SYSCALLS. +choice + prompt "Trim methods" if EXPERT + default RESTRICTED_TRIM_UNUSED_SYSCALLS + depends on TRIM_UNUSED_SYSCALLS + help + This option selects the method to trim unused syscall wrongly kept. + + The binary files compiled using both methods are identical. + + If the trim methods is not specified, some syscalls are kept by + linker script and can not be trimmed. + +config RESTRICTED_TRIM_UNUSED_SYSCALLS + bool "Leave some kept syscalls (EXPERIMENTAL)" if EXPERT + help + Say Y here to trim 'unused' syscalls wrongly kept by __ex_table + like sections in kernel space. + + Some syscalls are kept by linker script and can not be trimmed. + + If unsure, choose this. + +config SECTION_SHF_LINK_ORDER_SUPPORT + bool "Using SHF_LINK_ORDER attribute (EXPERIMENTAL)" if EXPERT + depends on HAVE_SECTION_SHF_LINK_ORDER_SUPPORT + help + Say Y here to trim more 'unused' syscalls wrongly kept by __ex_table + like sections in kernel space. + + This option uses the SHF_LINK_ORDER attribute to build references for + orphan sections. Therefore, these sections are no longer kept in the + linker script. + + If unsure, not choose this. + +config SECTION_SHF_GROUP_SUPPORT + bool "Using SHF_GROUP attribute (EXPERIMENTAL)" if EXPERT + depends on HAVE_SECTION_SHF_GROUP_SUPPORT + help + Say Y here to trim more 'unused' syscalls wrongly kept by __ex_table + like sections in kernel space. + + This option uses the SHF_GROUP attribute to build references for + orphan sections. Therefore, these sections are no longer kept in the + linker script. + + If unsure, not choose this. + +endchoice + config KALLSYMS bool "Load all symbols for debugging/ksymoops" if EXPERT default y From patchwork Fri Nov 3 16:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1141109vqu; Fri, 3 Nov 2023 09:02:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEueKWrPtLAZpyhJdjl6d1FT3h2zsEUe9zcHuUk9wLb8cXijbz0E8C4LKKtm89NHJ0bgVQV X-Received: by 2002:a05:6358:91e:b0:168:e2ec:593 with SMTP id r30-20020a056358091e00b00168e2ec0593mr28709725rwi.22.1699027346589; Fri, 03 Nov 2023 09:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027346; cv=none; d=google.com; s=arc-20160816; b=sj/5W7SejMfbLrdZYJBj0rVXOMG1ruroBzLjH5yhDZ01HpXcpDppId4pSNOOeQ4Gsi lJ8RCZSqRiwui4wAKasg+J0ojnnYyUXXvP83OEMBzrH4P6bBPejiU53OxVAEi0yfSxY1 oQlzjp9jn3fxa7BWtjEmEm2QP8TuN+yzLkZaQOwbAtTUxgxAuI/J0Meu7JC79S3er9+n 78paY0Mhg0gtymcaauqa0Hmhl3whyn3M7Yv9tiBEujEKv6vZ9LhcnkXLi5f473KvnYxY 3XB0dK+XLDucQorRpm/D/UZgQg/P+UdAH20dfJqQf4g6BRv7A9guYy2Ob9//RsAACHJM rcjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=f9nXIUwNePfy54JRc+pYeAbLGPpa0xZCKMAxDNMgXD4=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=qFkoFGnd2Lh7AgAM1Vjv2CO4dd+zxEo6M4hQvuYPchN6RwvPMzSgyiunCJLzmBUq3d ogH14ejElEB4hKz2y1Oo8gmHEfnuM9cF3wtsS8JGO6ViAKqmvP3O1e1yo9+hl521Zywc wLIzSQIh2LX70m3OgTX5S6d4TbluIaYbm3zw0S1qhHAIHKeWfmT/tNNOCb1fskOgLnjt SZeYAiG7uU3RDIlUCg0WwJTWtKt+QYCphmMJqI3y8QRiaM5xUXL8RPpIOQJjxMR20wdC FLbepgDrIzePVuDSf/kijcp06ykvFeLLPGM5mGv3A3H4kB7VlcuYN3/LhBiMQhr/pyvY psEA== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c130-20020a633588000000b005b9b68add85si1738176pga.254.2023.11.03.09.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 4B0EF821FBA4; Fri, 3 Nov 2023 09:02:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344951AbjKCQCT (ORCPT + 35 others); Fri, 3 Nov 2023 12:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344745AbjKCQCR (ORCPT ); Fri, 3 Nov 2023 12:02:17 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37180D4E; Fri, 3 Nov 2023 09:02:13 -0700 (PDT) X-QQ-mid: bizesmtp66t1699027320t0x8xgof Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:01:57 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: WQH7Uj+YMzXZTIeeYrzzH5itva0gXKImwAhNhNH+6I4DrfveqC5LRL/AcrFVZ 2/7bONsuYtIn2ySjQU5hL5gWFOT7EvhlXQ1iFCFG8OaKZP82pUKHeAwChH+M65VreM8t5le MEaIGsQTivG4RvqDkHbOYJyCINDKGWbhCKa0dUgjtXcRjNQmYo+pBt7KJc23OgX11rPo9HH eolIdA7eZrnIQZKidwNzLUodbR1P5fT1YDTe/GJ96w1sqVpiiORBTxHvJJR8fCReTgImbhn xk8Hctv3kJsMKpvxmjJqlVVP2vs4VDq6gBW71Z2pzucXzcbSYEcpsDNDwo0ITDvRO3EglyR gZFh+VYSI8gOs/YSPsMhwdqkvgrOUqcnzKKQlenAv7mO2o1OXg= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8381555887930633905 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 09/14] DCE/DSE: inhibit .size directive for SHF_GROUP Date: Sat, 4 Nov 2023 00:01:55 +0800 Message-Id: <7807078d4612beaa3f450df9f3f3cf70b2bccb4a.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 09:02:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559299215921856 X-GMAIL-MSGID: 1781559299215921856 .size directive fails in some functions with SHF_GROUP, this is not really required for normal building, inhibit it to silence the compiling failures with SHF_GROUP. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index a4e522b747cb..f67b6e8d2c45 100644 --- a/Makefile +++ b/Makefile @@ -936,6 +936,9 @@ endif # `rustc`'s `-Zfunction-sections` applies to data too (as of 1.59.0). ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections +ifdef CONFIG_SECTION_SHF_GROUP_SUPPORT +KBUILD_CFLAGS_KERNEL += -finhibit-size-directive +endif KBUILD_RUSTFLAGS_KERNEL += -Zfunction-sections=y LDFLAGS_vmlinux += --gc-sections ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION_DEBUG From patchwork Fri Nov 3 16:02:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1141908vqu; Fri, 3 Nov 2023 09:03:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHw9xm9GiCsCMCAWiK9WYkIaSsOd/B0l9FRlYcS/nZWtegNljlNNwtbgGei+tDG5JjXk4Vx X-Received: by 2002:a05:6870:724e:b0:1e9:6a4e:6b56 with SMTP id y14-20020a056870724e00b001e96a4e6b56mr1767682oaf.3.1699027391771; Fri, 03 Nov 2023 09:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027391; cv=none; d=google.com; s=arc-20160816; b=JPuJ3SFjeBYpUphYhLXJKDtDNUO++s0oISxfgC/vwkY61rgl5nMSVAObl/Jpoi0CSw V//VU/+z6O7gZPsCKUAVT0pC1bbqjGVYFYkJ5gS0rBa0K1tT9jbTPUe31h3YNBsx80CQ OIMUTFCudnVKYaA+NzMzea2+LV15xI9MW8WNwa/SRc32iWt91UWhEwc8Daio9uxSobHK GMmVdMx5PEsBnmLswRD7LiNfYsJO2Na3TPb6xQyZksorMm3z1rnsS84eZOozhO2H0yGA 7GZLHW1eyXQzUJB6P0q2E8vCiOlwJJwrhO28uBfU4TbQ5Bui7V3DEJbL4xZrYGcyKbJU 7gvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=IGWZZDOEs1Sdxq1a2878wAXkTBuQKsf9nxloyDmOnx0=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=dD8ZodYZpbUJZB/5EnxGqYHaQCxoOTXYXlm3NfUhbMeSy/xep40f1+bdYwSQ32o0PR Z9jvhOO7B8nVspODydQ6VsP9WwxtsBVCSFYm4P1n/3pFMUzwrLPM4p8oG3KhWWAyzaW0 jVFMcFZsGW2nUcJJ0DTQ5OlUCigJvp5zAXdCihJqrjtjaBzfmouVnwCCwNE/z+DjyQVS jSXQ1sQPSXiZWMbXvySdQ65tIkPZj5GAcBW64QaFMzvmEy4kj6Da9Mnq9ywENRadse8R 5YvDRhO0qGR+5tDBYIYP1Si8651w8tuNdNPjTlBiCXL3CYdpMgqEgsyQX6ibNMp01cF4 x3kQ== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id gr26-20020a056870aa9a00b001dced965728si784226oab.74.2023.11.03.09.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 1D9A68220D57; Fri, 3 Nov 2023 09:03:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345139AbjKCQCo (ORCPT + 35 others); Fri, 3 Nov 2023 12:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345199AbjKCQCm (ORCPT ); Fri, 3 Nov 2023 12:02:42 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD69D1BF; Fri, 3 Nov 2023 09:02:38 -0700 (PDT) X-QQ-mid: bizesmtp91t1699027345tuzi88hk Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:02:22 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: YlW+rreuxxXoxvlIlb1sqNHnSOT+l5Yn7jheMGM0MN7wg16F1FQezu3ESPCIn SG4dX7pl9FbKYtPlw5xFGKF9hdEiY4GXCO8Dcbx8/cg7Og+QCU3+CXMPCfzr3ILF+7b8OJC We3CArNs3/RzbQomd2+K7yNXkmGAdxxgFstmrUQolP47JcSLPCcnWVH+pzG+WBKc95SRuk6 GRNeVQS005EaooagskyJFuMF58jFp792MV4/nMVDor5tdI0R+v9ntYb8OLdlo+bjQBPaFjZ 3tXMXILkQNqiZOfSFuWlhMCs5t5EvoYMyXZptegM68V3A/gfjehT5qri7Me9UwyV2uMy7Yw qI4nF3fFj9RVpkTbEo40dXUlw5DXyqiA0exePUzOcNNH73+MM0= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1289692222090341736 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 10/14] DCE/DSE: riscv: make every ex_table's name unique Date: Sat, 4 Nov 2023 00:02:18 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 09:03:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559346327497823 X-GMAIL-MSGID: 1781559346327497823 gc-sections require section names to be unique. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- arch/riscv/include/asm/asm-extable.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/include/asm/asm-extable.h b/arch/riscv/include/asm/asm-extable.h index 00a96e7a9664..d0be5a838242 100644 --- a/arch/riscv/include/asm/asm-extable.h +++ b/arch/riscv/include/asm/asm-extable.h @@ -9,10 +9,12 @@ #ifdef CONFIG_MMU +#include + #ifdef __ASSEMBLY__ #define __ASM_EXTABLE_RAW(insn, fixup, type, data) \ - .pushsection __ex_table, "a"; \ + .pushsection __SECTION_NAME(__ex_table), "a"; \ .balign 4; \ .long ((insn) - .); \ .long ((fixup) - .); \ @@ -31,7 +33,7 @@ #include #define __ASM_EXTABLE_RAW(insn, fixup, type, data) \ - ".pushsection __ex_table, \"a\"\n" \ + ".pushsection " __SECTION_NAME(__ex_table) ", \"a\"\n" \ ".balign 4\n" \ ".long ((" insn ") - .)\n" \ ".long ((" fixup ") - .)\n" \ From patchwork Fri Nov 3 16:02:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1142753vqu; Fri, 3 Nov 2023 09:04:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBce1D05a6mkQX2VMVDHv7worCABBmo+RjeZ63sGzk53rBx8merK4ih3s9WZN6WY1FqOn0 X-Received: by 2002:a17:902:cec1:b0:1cc:345b:c7e1 with SMTP id d1-20020a170902cec100b001cc345bc7e1mr14033108plg.60.1699027443417; Fri, 03 Nov 2023 09:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027443; cv=none; d=google.com; s=arc-20160816; b=N/Ou89TDQkxUd0F9aBzWMeD4KkkReE4crB28Zc8nKdbwhrEkxM+Zzrij5lTZ0pIQHQ sAAQhOw6TbBpbfvE9JWm07iok3Fbyfwe6GgnjKuOgDh5dezWEmyV1JoCPCORkwM2dHnl ncO0EF3kCDTNEbM6DJYtiW2Tq2OyBWZ9Hd56WshT2ZfAsTC2PjrRWCDiAljC995r1vis 23peRelXIm2XES0GDDKqg6m9VvU5z1hvUdE9u/awAYkfaZBtDFOeJ9VR/tDEorgQ3zj6 9xKUDeRKZC51XJVLnlawy2Z+zJ2ULuiqjbeyqidNZZ3zPG8nILJcxe2pBbb5LY0VNBVU ic+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=1kK6ZuSLmouKcwypfTS0Df9pjPt7VBA9e17wwKRHkSM=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=cmUHhDs3dHFiCoRAY/uDPcg1xM6UrwyKvFYvVmaBCJlceY1GQ0K/WHWgDhcBhTzA/c 8Cl73IR7y0n6/W2cG9qjXkEaAqQ2+wPzMu2SJw23EAvDmaDFobXZnT0hVtUiZXyu+xXx iuKkwpnhKSdVTsbt6YBbnLTHBQzfO3xRTNKe6BpB9JoDOcs02wOD9UkaV2UZPmbEZFUZ m30SpGN4px3cfPd1kFPJsX2agClBFLo2VIhMoJk1eMzMIaOpP92dlOThay0cVR/S8Qlc DUQGkVwqRXOP4EJHmbZ8EzP1ojdVNTClGCMJKtBRpDFDODTQesN9FZBdKzDKtuhHVSml OBtQ== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id w15-20020a170902e88f00b001cc4770b9aesi1792065plg.419.2023.11.03.09.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 660BB832F640; Fri, 3 Nov 2023 09:03:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343933AbjKCQDV (ORCPT + 35 others); Fri, 3 Nov 2023 12:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234637AbjKCQDQ (ORCPT ); Fri, 3 Nov 2023 12:03:16 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60516D5B; Fri, 3 Nov 2023 09:03:10 -0700 (PDT) X-QQ-mid: bizesmtp71t1699027375tdhm453g Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:02:52 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: NcwpCxVQ7UNhf+mNoYKTlmUzCKrTx3/uLfRK9iw8b01sSRqpsgDYV8WUoq0+F bEVqW3uxHwMcq7cQk2v9IJTcEH5r/B/VLMPT6wOIogDyXcUP+URvzaHAuu/LDdBPo2y2PfX 7Mvj8Mqe2Ivk0sKa4LuqIN72w9m3gc5Lcqg/zqWO640FM0vG0kG9EircxCKhMl7uzB00yoH 1GP93ZVIalqTmrPj4vUjf6sev/hgXIrNQSDbJHjlwx52aJ9EmGcU4IM89eMwaKIUIKHp/FG vghOQ3hDkGX/eU+m4e94hHqprk/L/vOU8YSOvFJylFesXI+PLvYCD4xzTz8P1EhFUlvtRb/ xog9r+mNfQz65z8LEQVxAy/3lxXueH3B9eIMSnlsByWsQU4YjU= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14770929756585809619 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 11/14] DCE/DSE: riscv: build reference for .pushsection in C functions Date: Sat, 4 Nov 2023 00:02:50 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 09:03:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559400714337096 X-GMAIL-MSGID: 1781559400714337096 Add the SECTION_SHF_LINK_ORDER method and the SECTION_SHF_GROUP method to refactor __ASM_EXTABLE_RAW, so it won't produce orphan sections anymore. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- arch/riscv/include/asm/asm-extable.h | 34 ++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/arch/riscv/include/asm/asm-extable.h b/arch/riscv/include/asm/asm-extable.h index d0be5a838242..7164d871e038 100644 --- a/arch/riscv/include/asm/asm-extable.h +++ b/arch/riscv/include/asm/asm-extable.h @@ -13,6 +13,21 @@ #ifdef __ASSEMBLY__ +#if defined(CONFIG_SECTION_SHF_LINK_ORDER_SUPPORT) +#define __ASM_EXTABLE_PUSH_SECTION \ + __LABEL_NAME(.L__ex_table) : \ + .pushsection __SECTION_NAME(__ex_table), "ao", __LABEL_NAME(.L__ex_table) + +#elif defined(CONFIG_SECTION_SHF_GROUP_SUPPORT) +#define __ASM_EXTABLE_PUSH_SECTION \ + .attach_to_group __SECTION_NAME(__ex_table); \ + .pushsection __SECTION_NAME(__ex_table), "a?" + +#else +#define __ASM_EXTABLE_PUSH_SECTION \ + .pushsection __SECTION_NAME(__ex_table), "a" +#endif + #define __ASM_EXTABLE_RAW(insn, fixup, type, data) \ .pushsection __SECTION_NAME(__ex_table), "a"; \ .balign 4; \ @@ -32,8 +47,23 @@ #include #include -#define __ASM_EXTABLE_RAW(insn, fixup, type, data) \ - ".pushsection " __SECTION_NAME(__ex_table) ", \"a\"\n" \ +#ifdef CONFIG_SECTION_SHF_LINK_ORDER_SUPPORT +#define __ASM_EXTABLE_PUSH_SECTION \ + __LABEL_NAME(.L__ex_table) ":" \ + ".pushsection " __SECTION_NAME(__ex_table) ", \"ao\"," __LABEL_NAME(.L__ex_table) "\n" + +#elif defined(CONFIG_SECTION_SHF_GROUP_SUPPORT) +#define __ASM_EXTABLE_PUSH_SECTION \ + ".attach_to_group " __SECTION_NAME(__ex_table) "\n" \ + ".pushsection " __SECTION_NAME(__ex_table) ", \"a?\"\n" + +#else +#define __ASM_EXTABLE_PUSH_SECTION \ + ".pushsection " __SECTION_NAME(__ex_table) ", \"a\"\n" +#endif + +#define __ASM_EXTABLE_RAW(insn, fixup, type, data) \ + __ASM_EXTABLE_PUSH_SECTION \ ".balign 4\n" \ ".long ((" insn ") - .)\n" \ ".long ((" fixup ") - .)\n" \ From patchwork Fri Nov 3 16:04:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuan Tan X-Patchwork-Id: 161360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1145250vqu; Fri, 3 Nov 2023 09:06:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtiuD2Vmcl+q0BVOnhnrnw/gpv78NrLrf3+W1Ang3GEeFy4maZoo3N7DZhuPPdR/7EBHl6 X-Received: by 2002:a05:6830:6210:b0:6d3:1fff:f915 with SMTP id cd16-20020a056830621000b006d31ffff915mr7597045otb.23.1699027587379; Fri, 03 Nov 2023 09:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699027587; cv=none; d=google.com; s=arc-20160816; b=y8y2hO5zIQsOBBP3QrR71cGPqQfPNJiaZtAAxWk7aFPqsMQ3UiWOlGijKTEVFx95Zu iCPaLZhXIcws8oUak6b8k7bAlwzJSGPrOwTrkMXRySb64fk8++/zeU146crMi4NyValF Q01UpOm0+BDODH/+56lLrM/BT/rx7eGkcPw/Oib4NtAMD4m/+UqBim3bp2X5gTUV5wLi YzbdcEEycRtyfxsg4+4AcPQXa8KI/jw+kC9YDil4fT9CPn37ffBvKOH7UhaGJoz6gUtt e+Qi6MV3sstuI+JDTz0wC6Yz+R9808DxXV/h3KzRhfgaGrhVhY7dQVhLCl087sD8HQub u78A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=d1YaUh1CfijQRC6TNy4bZy0v2enH+BfjtNHEyDeILIU=; fh=NvW3CO3GtIHRKW4YFObS4dEX0yL9bbz2APezTtyZGhQ=; b=w3oi/JunKAspZjx+h7PfIPZRBbJ33umizEoULJYrEKvaYdKQamXRszulWLll2a0CZq cncPf72Wo7725j+LtE1xStGsu8TdO8RMks3DmMPZqDW5T51zFt3t0OFNhVEZ9dY/JqEr okB34gNnSssfucwtH49TTWZ2s/UxA70E03B4a7hFOrXYuetKcCbbNspF3Yuq4X3oX/0w bqJ6QAsLXf1lMbhYM4ZvJ1dPQN9u8RbYu9OfKseDvZ1lGBVwPxqGsuo0SykkNwMxJzR6 7Pm28voJ1V0G6jcgrO1J6Io6ZFPkGDTH7+y1jdXQQ7gDCRY7IW3ZXywLBiD0YJNQlMaE zJeQ== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id g8-20020a056830308800b006ce2f3b77b7si763076ots.219.2023.11.03.09.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 09:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 52A268048C1E; Fri, 3 Nov 2023 09:05:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234377AbjKCQFc (ORCPT + 35 others); Fri, 3 Nov 2023 12:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234387AbjKCQF3 (ORCPT ); Fri, 3 Nov 2023 12:05:29 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C3110C6; Fri, 3 Nov 2023 09:05:07 -0700 (PDT) X-QQ-mid: bizesmtp88t1699027493t4lqanvg Received: from main2-ubuntu.tail147f4.ts.net ( [202.201.15.117]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Nov 2023 00:04:50 +0800 (CST) X-QQ-SSF: 01200000000000B06000000A0000000 X-QQ-FEAT: jXjag1m6xl5ppx2DzruJtGaZWnmD4kcr8XGhe8RzDeQnj/4txlNMA0RrzbdM3 NkLCpOnAtszVCaalBQWVPDXpaXS99zJq6AlrppFnw1HKvKL0xj0E5A9V7XJ4MlTzYMuw81z fr0TQpqQaEJWCRXcAtRVJi0F1ePqT0AT21/h93uarocjC8Z8j1tjIaNhhk3tVoz+rnGhrAd TRL0MreVOn2ipogbXqRHd+i6op09393O4FSiuY8ril1xpaW3/uszhT2UDapIXWOaUz+PptB f2CN/td6z1BqlmsTzYJ3ewPyBma8ADUsb5d7vDUH3TMXEtfm+e3ucDioNeOaMAYycbIr9aJ /sF2ho7MXuFQ17Wh2UAABl458F674OLb8zGA6HrpmOBwvwfV8QFEVjuC0lUdg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11412250178732425861 From: Yuan Tan To: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, luc.vanoostenryck@gmail.com, linux-sparse@vger.kernel.org Cc: linux@weissschuh.net, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tim.bird@sony.com, tsbogend@alpha.franken.de, w@1wt.eu, tanyuan@tinylab.org, i@maskray.me Subject: [PATCH v1 14/14] DCE/DSE: vmlinux.lds.h: allow NO_KEEP on __ex_table sections Date: Sat, 4 Nov 2023 00:04:48 +0800 Message-Id: <3acff566dc1818a36b32a34e25b0de58c5118ee6.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 09:05:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781559551322506068 X-GMAIL-MSGID: 1781559551322506068 With SHF_LINK_ORDER or SHF_GROUP, all of the __extable sections are no longer orphan sections. In this case, KEEP() is no longer needed. Signed-off-by: Yuan Tan Signed-off-by: Zhangjin Wu --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f10afc42a1ac..e5e5850ea573 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -658,7 +658,7 @@ #define EXCEPTION_TABLE(align) \ . = ALIGN(align); \ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(__ex_table, ___ex_table) \ + BOUNDED_SECTION_BY(__ex_table, ___ex_table, NO_KEEP) \ } /*