linux-yocto/rust
FUJITA Tomonori c765f592ad rust: module: place cleanup_module() in .exit.text section
[ Upstream commit 249c3a0e53 ]

Place cleanup_module() in .exit.text section. Currently,
cleanup_module() is likely placed in the .text section. It's
inconsistent with the layout of C modules, where cleanup_module() is
placed in .exit.text.

[ Boqun asked for an example of how the section changed to be
  put in the log. Tomonori provided the following examples:

    C module:

      $ objdump -t ~/build/x86/drivers/block/loop.o|grep clean
      0000000000000000 l     O .exit.data    0000000000000008 __UNIQUE_ID___addressable_cleanup_module412
      0000000000000000 g     F .exit.text    000000000000009c cleanup_module

    Rust module without this patch:

      $ objdump -t ~/build/x86/samples/rust/rust_minimal.o|grep clean
      00000000000002b0 g     F .text         00000000000000c6 cleanup_module
      0000000000000000 g     O .exit.data    0000000000000008 _R...___UNIQUE_ID___addressable_cleanup_module

    Rust module with this patch:

      $ objdump -t ~/build/x86/samples/rust/rust_minimal.o|grep clean
      0000000000000000 g     F .exit.text    00000000000000c6 cleanup_module
      0000000000000000 g     O .exit.data    0000000000000008 _R...___UNIQUE_ID___addressable_cleanup_module

  - Miguel ]

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20250308044506.14458-1-fujita.tomonori@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-06 11:00:06 +02:00
..
alloc rust: upgrade to Rust 1.73.0 2024-02-16 19:10:43 +01:00
bindings
kernel rust: lockdep: Remove support for dynamically allocated LockClassKeys 2025-03-22 12:50:50 -07:00
macros rust: module: place cleanup_module() in .exit.text section 2025-07-06 11:00:06 +02:00
uapi
.gitignore
bindgen_parameters rust: Ignore preserve-most functions 2024-01-25 15:35:41 -08:00
build_error.rs
compiler_builtins.rs rust: upgrade to Rust 1.73.0 2024-02-16 19:10:43 +01:00
exports.c
helpers.c
Makefile rust: kbuild: fix export of bss symbols 2024-09-12 11:11:32 +02:00