From: Alex Hung <alex.hung@amd.com>
To: richard@nod.at, anton.ivanov@cambridgegreys.com,
johannes@sipsolutions.net, nathan@kernel.org,
linux-um@lists.infradead.org
Subject: Re: [PATCH 1/1[RFC] um: include .fini_array.* in linker scripts
Date: Wed, 8 Jul 2026 15:42:11 -0600 [thread overview]
Message-ID: <eea36454-cbbe-4690-980d-b4ec9423f3a0@amd.com> (raw)
In-Reply-To: <a497ca92-9157-4ab1-982b-4dab4cab2de1@amd.com>
Ping for comments again.
I found a similar patch from 2021 by Johannes Berg:
https://lkml.iu.edu/hypermail/linux/kernel/2103.1/06608.html
Is there a reason that this or previous patch has concerns and cannot be
included in kernel?
Cheers,
Alex
On 6/2/26 18:19, Alex Hung wrote:
> Hi,
>
> Are there any concerns or comments on this patch?
>
> On 5/12/26 17:26, Alex Hung wrote:
>> GCC emits per-translation-unit gcov destructors into
>> .fini_array.NNNNN sections (prioritized). The UML linker
>> scripts only captured *(.fini_array), silently discarding
>> all prioritized destructor entries.
>>
>> As a result, gcov's __gcov_exit never ran at process halt
>> and no .gcda files were written after KUnit tests completed.
>>
>> Add *(.fini_array.*) to common.lds.S and dyn.lds.S, mirroring
>> the existing *(.init_array.*) pattern already present for
>> constructors.
>>
>> Signed-off-by: Alex Hung <alex.hung@amd.com>
>> Assisted-by: Copilot:Claude-Sonnet-4.6
>> ---
>> arch/um/include/asm/common.lds.S | 1 +
>> arch/um/kernel/dyn.lds.S | 2 +-
>> 2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/
>> common.lds.S
>> index fd481ac371de..336361412b47 100644
>> --- a/arch/um/include/asm/common.lds.S
>> +++ b/arch/um/include/asm/common.lds.S
>> @@ -90,6 +90,7 @@
>> }
>> .fini_array : {
>> __fini_array_start = .;
>> + *(.fini_array.*)
>> *(.fini_array)
>> __fini_array_end = .;
>> }
>> diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
>> index ad3cefeff2ac..fbd8d559f21f 100644
>> --- a/arch/um/kernel/dyn.lds.S
>> +++ b/arch/um/kernel/dyn.lds.S
>> @@ -113,7 +113,7 @@ SECTIONS
>> *(.init_array.*)
>> *(.init_array)
>> }
>> - .fini_array : { *(.fini_array) }
>> + .fini_array : { *(.fini_array.*) *(.fini_array) }
>> .data : {
>> INIT_TASK_DATA(KERNEL_STACK_SIZE)
>> DATA_DATA
>> --
>> 2.43.0
>>
>
prev parent reply other threads:[~2026-07-08 21:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 23:26 [PATCH 0/1][RFC] Fix no gcda files with kunit.py Alex Hung
2026-05-12 23:26 ` [PATCH 1/1[RFC] um: include .fini_array.* in linker scripts Alex Hung
2026-06-03 0:19 ` Alex Hung
2026-07-08 21:42 ` Alex Hung [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eea36454-cbbe-4690-980d-b4ec9423f3a0@amd.com \
--to=alex.hung@amd.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=johannes@sipsolutions.net \
--cc=linux-um@lists.infradead.org \
--cc=nathan@kernel.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox