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
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
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