From: Johannes Berg <johannes@sipsolutions.net>
To: linux-kernel@vger.kernel.org, linux-um@lists.infradead.org
Cc: Jessica Yu <jeyu@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/6] module: add support for CONFIG_MODULE_DESTRUCTORS
Date: Fri, 12 Mar 2021 11:26:17 +0100 [thread overview]
Message-ID: <0375326f2f20dc82c056d41faee97489a1a03677.camel@sipsolutions.net> (raw)
In-Reply-To: <20210312104627.8b2523b0593c.Ib0fb7906e3d7bd69ebe5eb877e2e9f33ef915d4b@changeid>
On Fri, 2021-03-12 at 10:55 +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> At least in ARCH=um with CONFIG_GCOV (which writes all the
> coverage data directly out from the userspace binary rather
> than presenting it in debugfs) it's necessary to run all
> the atexit handlers (dtors/fini_array) so that gcov actually
> does write out the data.
>
> Add a new config option CONFIG_MODULE_DESTRUCTORS that can
> be selected via CONFIG_WANT_MODULE_DESTRUCTORS that the arch
> selects (this indirection exists so the architecture doesn't
> have to worry about whether or not CONFIG_MODULES is on).
> Additionally, the architecture must then (when it exits and
> no more module code can run) call run_all_module_destructors
> to run the code for all modules that are still loaded. When
> modules are unloaded, the handlers are called as well.
Oops, I forgot to add this bit to the patch:
--- a/scripts/module.lds.S
+++ b/scripts/module.lds.S
@@ -16,6 +16,8 @@ SECTIONS {
.init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
+ .fini_array 0 : ALIGN(8) { *(SORT(.fini_array.*)) *(.fini_array) }
+
__jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
__patchable_function_entries : { *(__patchable_function_entries) }
Should that be under the ifdef? .init_array isn't, even though it's only
relevant for CONFIG_CONSTRUCTORS.
johannes
next prev parent reply other threads:[~2021-03-12 10:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 9:55 [PATCH 0/6] um: fix up CONFIG_GCOV support Johannes Berg
2021-03-12 9:55 ` [PATCH 1/6] seq_file: rename mangle_path to seq_mangle_path Johannes Berg
2021-03-12 9:55 ` [PATCH 2/6] module: add support for CONFIG_MODULE_DESTRUCTORS Johannes Berg
2021-03-12 10:26 ` Johannes Berg [this message]
2021-03-12 9:55 ` [PATCH 3/6] .gitignore: also ignore gcda files Johannes Berg
2021-03-12 9:55 ` [PATCH 4/6] um: split up CONFIG_GCOV Johannes Berg
2021-03-18 21:27 ` Brendan Higgins
2021-03-18 21:30 ` Johannes Berg
2021-03-12 9:55 ` [PATCH 5/6] um: fix CONFIG_GCOV for built-in code Johannes Berg
2021-03-12 9:55 ` [PATCH 6/6] um: fix CONFIG_GCOV for modules Johannes Berg
2021-03-12 14:33 ` [PATCH 0/6] um: fix up CONFIG_GCOV support Johannes Berg
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=0375326f2f20dc82c056d41faee97489a1a03677.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jeyu@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).