Re: [PATCH v2 06/13] rust: modernize link_section usage for ELF platforms

2024-10-23 Thread Paolo Bonzini
Il mer 23 ott 2024, 17:15 Zhao Liu ha scritto: > > let expanded = quote! { > > #[allow(non_upper_case_globals)] > > #[used] > > -#[cfg_attr(target_os = "linux", link_section = ".ctors")] > > -#[cfg_attr(target_os = "macos", link_section = > "__DATA,__mod_ini

Re: [PATCH v2 06/13] rust: modernize link_section usage for ELF platforms

2024-10-23 Thread Zhao Liu
On Mon, Oct 21, 2024 at 06:35:31PM +0200, Paolo Bonzini wrote: > Date: Mon, 21 Oct 2024 18:35:31 +0200 > From: Paolo Bonzini > Subject: [PATCH v2 06/13] rust: modernize link_section usage for ELF > platforms > X-Mailer: git-send-email 2.46.2 > > Some newer ABI implement

[PATCH v2 06/13] rust: modernize link_section usage for ELF platforms

2024-10-21 Thread Paolo Bonzini
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