From 06b5b7cc3ce18d25c4c461198cbae304891c49eb Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 24 Jan 2025 13:32:53 +0200 Subject: [PATCH] csu: add the "Retain" flag to notes sections flag It should make the notes immune against --gc-sections. Reported by: bapt Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/csu/common/crtbrand.S | 2 +- lib/csu/common/feature_note.S | 2 +- lib/csu/common/ignore_init_note.S | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/csu/common/crtbrand.S b/lib/csu/common/crtbrand.S index b59e2fd8056b..a06f72daa99d 100644 --- a/lib/csu/common/crtbrand.S +++ b/lib/csu/common/crtbrand.S @@ -36,7 +36,7 @@ * for more information. */ - .section .note.tag,"aG",%note,.freebsd.noteG,comdat + .section .note.tag,"aGR",%note,.freebsd.noteG,comdat .p2align 2 .4byte 2f-1f .4byte 4f-3f diff --git a/lib/csu/common/feature_note.S b/lib/csu/common/feature_note.S index 5c1d56d4cde1..fb9f6141699e 100644 --- a/lib/csu/common/feature_note.S +++ b/lib/csu/common/feature_note.S @@ -29,7 +29,7 @@ #include #include "notes.h" - .section .note.tag,"a",%note + .section .note.tag,"aR",%note .p2align 2 .4byte 2f-1f .4byte 4f-3f diff --git a/lib/csu/common/ignore_init_note.S b/lib/csu/common/ignore_init_note.S index 57fb4e8f4d51..d78be61f17a9 100644 --- a/lib/csu/common/ignore_init_note.S +++ b/lib/csu/common/ignore_init_note.S @@ -30,7 +30,7 @@ #include "notes.h" - .section .note.tag,"a",%note + .section .note.tag,"aR",%note .p2align 2 .4byte 2f-1f .4byte 4f-3f -- 2.48.1