[avr,applied] PR17107: Add more .gnu.linkonce section patterns to avr.sc

Message ID 28685df3-ca1e-4659-8271-baedb8937bfe@gjlay.de
State New
Headers
Series [avr,applied] PR17107: Add more .gnu.linkonce section patterns to avr.sc |

Commit Message

Georg-Johann Lay June 23, 2026, 12:24 p.m. UTC
  Added rules for .gnu.linkonce.t* and .gnu.linkone.b* to avr.sc.

Applied to trunk as obvious.

Johann

--

AVR: PR17107 - Add more .gnu.linkonce to avr.sc

This patch adds pattern rules for .gnu.linkonce.t* and .gnu.linkone.b*
to the .text resp. .bss output sections.  Though that's probably
not needed any more since G++ is using COMDAT today.
.gnu.linkonce.d* for .data and .gnu.linkone.r* for .rodata are
already there.

	PR ld/17107
ld/
	* scripttempl/avr.sc (.bss) [RELOCATING]: Add *(.gnu.linkonce.b*).
	(.text) [RELOCATING]: Add *(.gnu.linkonce.t*).
  

Patch

diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
index e1c3a4bcee7..b3cf421a78b 100644
--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -271,6 +271,8 @@  cat <<EOF
     *(.fini0)  /* Infinite loop after program termination.  */
     KEEP (*(.fini0))
 
+    *(.gnu.linkonce.t*)
+
     /* For code that needs not to reside in the lower progmem.  */
     *(.hightext)
     *(.hightext*)
@@ -336,6 +338,7 @@  cat <<EOF
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)
     ${RELOCATING+ *(.bss*)}
+    ${RELOCATING+ *(.gnu.linkonce.b*)}
     ${RELOCATING+ *(COMMON)}
     ${RELOCATING+ PROVIDE (__bss_end = .) ; }
   } ${RELOCATING+ > data}