]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: modernize link_section usage for ELF platforms
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Oct 2024 13:03:01 +0000 (15:03 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Nov 2024 13:18:15 +0000 (14:18 +0100)
commit4f7521916d12e07d25d5175f2da9614624344a7b
tree5aa418f17e6fd951da8ee8ffa769ba70981df03b
parent2eb6274d12b92eb57dc6fa0516c4248509f4a66a
rust: modernize link_section usage for ELF platforms

Some newer ABI implementations do not provide .ctors; and while
some linkers rewrite .ctors into .init_array, not all of them do.
Use the newer .init_array ABI, which works more reliably, and
apply it to all non-Apple, non-Windows platforms.

This is similar to how the ctor crate operates; without this change,
"#[derive(Object)]" does not work on Fedora 41.

Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api-macros/src/lib.rs
rust/qemu-api/src/definitions.rs