From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by sourceware.org (Postfix) with ESMTPS id C90C23858409 for ; Fri, 21 Jul 2023 15:14:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C90C23858409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tinylab.org X-QQ-mid: bizesmtpipv603t1689952464tu2r Received: from archlinux.tail147f4.ts.net ( [255.3.167.7]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 21 Jul 2023 23:14:23 +0800 (CST) X-QQ-SSF: 01200000000000001000000A0000000 X-QQ-FEAT: lgayfWJN6rwz1BeOg+dzWnPwDJNyFXSS17oSF460cZP+bUdfGQhrQ5I5DW++Y TwbRjLN+LKVjz+9T01YneAjEwtU/AJ963oxWgMnojhwV++uI72jq3ouadWrMvoeXC3N7luf myEHpq1+ltWRj4atZ9gi8ixg05ZKXvpzAjSWJ4vB/hYRt79NKugE8GHc+j7uD3V4buB/ytn 1L0pV7dN9I21Kpv6JcFoIOOLvMGQTK05A4+bKFPmJJx8wNT7Xlw+5Jo66FsGGewe7f309o+ T4k4+O7qqTzKmGPmATHpYv9sHcYPPzq+k+MzWIOelReDT0MHuWj8lXOYlOkLNBgXuXIUIRa J/d80cO28aZVDvtVeA= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4962743597024388834 From: Tan Yuan To: binutils@sourceware.org, amodra@gmail.com, jbeulich@suse.com Cc: Tan Yuan Subject: [PATCH 0/1] gas: add new command line option --no-group-check Date: Fri, 21 Jul 2023 23:14:20 +0800 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpipv:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,RCVD_ILLEGAL_IP,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, list This patch introduces a new option that allows suppressing the warning when attaching a group to a section that already belongs to a group. The kernel extensively uses the ".pushsection" directive, which poses issues with proper reference building and garbage collection. To address this problem, the kernel uses "KEEP" in the linker script to prevent certain sections from being garbage collected. Consequently, some sections that should have been garbage collected are retained. For instance, if the section pusher is being garbage collected, the pushed sections are also supposed to be collected, but the linker script retains them. To resolve this, we can utilize ".attach_to_group" alongside ".pushsection," which enables the section pusher and the pushed sections to be grouped together, making them either eligible for garbage collection or kept together. Currently, the kernel encapsulates the use of ".pushsection" within macros, leading to thousands of instances where these macros are expanded. Rather than adding ".attach_to_group" to a thousand functions, we can incorporate it into this macro. However, some functions expand this macro multiple times, resulting in multiple attachments to the group for those functions. Unfortunately, there is no alternative method to ensure a single expansion of ".attach_to_group" As a solution, we propose adding an option to address this issue. Thanks. Tan Yuan (1): gas: add new command line option --no-group-check gas/as.c | 10 +++++++++- gas/as.h | 3 +++ gas/config/obj-elf.c | 2 +- gas/doc/as.texi | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) -- 2.41.0