Message ID | f0ee9abfd8d7b27489a4efe3196813225ce5680f.1699025537.git.tanyuan@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;heyuhang3455@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <tanyuan@tinylab.org> 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: <f0ee9abfd8d7b27489a4efe3196813225ce5680f.1699025537.git.tanyuan@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1699025537.git.tanyuan@tinylab.org> References: <cover.1699025537.git.tanyuan@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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 |
Series |
DCE/DSE: Add Dead Syscalls Elimination support, part2
|
|
Commit Message
Yuan Tan
Nov. 3, 2023, 4:02 p.m. UTC
gc-sections require section names to be unique. Signed-off-by: Yuan Tan <tanyuan@tinylab.org> Signed-off-by: Zhangjin Wu <falcon@tinylab.org> --- arch/riscv/include/asm/asm-extable.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On Fri, Nov 3, 2023 at 9:02 AM Yuan Tan <tanyuan@tinylab.org> wrote: > > gc-sections require section names to be unique. This is not precise, since a monolithic section can be garbage collected as well. https://maskray.me/blog/2021-02-28-linker-garbage-collection "Without the options, the compiler tends to produce monolithic text and data sections. The large sections make the GC coarse-grained and they will likely be retained as a whole. ld --gc-sections can still discard some sections, but the effect is likely very poor." > Signed-off-by: Yuan Tan <tanyuan@tinylab.org> > Signed-off-by: Zhangjin Wu <falcon@tinylab.org> > --- > 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 <linux/compiler.h> > + > #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 <asm/gpr-num.h> __SECTION_NAME is probably added by a previous patch. An alternative is to use the .section directive's `unique` feature (binutils>=2.35). > #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" \ > -- > 2.34.1 >
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 <linux/compiler.h> + #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 <asm/gpr-num.h> #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" \