bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/28124] ld: Make special sections in a section group GCable


From: amodra at gmail dot com
Subject: [Bug ld/28124] ld: Make special sections in a section group GCable
Date: Fri, 16 Feb 2024 01:01:45 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28124

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-02-16

--- Comment #2 from Alan Modra <amodra at gmail dot com> ---
It isn't that SHT_INIT_ARRAY sections are treated specially (although they are
for ld -r).  The reason why .init_array.bbb and .init_array.a is kept is the
KEEP in the default linker script:

  .init_array    :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o
*crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }

The pattern .init_array.* is there to match .init_array.65530 or similar with a
numeric suffix.  (In fact, it's probably wrong to match other named .init_array
sections there, but that's a side issue.)

KEEP operates on the named sections regardless of whether they are part of a
group or not.  We'd need to change the behaviour of KEEP (or invent a new
keyword) if .init_array inside a group was to be gc'ed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]