public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/1] gas: add new command line option --no-group-check
@ 2023-07-21 15:14 Tan Yuan
  2023-07-21 22:55 ` Alan Modra
  2023-07-22  0:32 ` Song Fangrui
  0 siblings, 2 replies; 9+ messages in thread
From: Tan Yuan @ 2023-07-21 15:14 UTC (permalink / raw)
  To: binutils, amodra, jbeulich; +Cc: Tan Yuan

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


^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <DS7PR12MB5765A326273E125586D742F7CB3CA@DS7PR12MB5765.namprd12.prod.outlook.com>]

end of thread, other threads:[~2023-07-24  9:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21 15:14 [PATCH 0/1] gas: add new command line option --no-group-check Tan Yuan
2023-07-21 22:55 ` Alan Modra
2023-07-22  3:47   ` Tan Yuan
2023-07-22  3:56     ` Xi Ruoyao
2023-07-23  9:31       ` Tan Yuan
2023-07-22  0:32 ` Song Fangrui
     [not found] <DS7PR12MB5765A326273E125586D742F7CB3CA@DS7PR12MB5765.namprd12.prod.outlook.com>
2023-07-23  9:10 ` Tan Yuan
2023-07-23 17:15   ` Fangrui Song
2023-07-24  9:28 ` Tan Yuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).