implement the #[shared] attribute as specified in RFC #211

This commit is contained in:
Jorge Aparicio 2019-07-11 12:53:58 +02:00
parent 9195038c87
commit fb84029bee

View file

@ -42,7 +42,11 @@ pub fn codegen(
let cfgs = &local.cfgs; let cfgs = &local.cfgs;
has_cfgs |= !cfgs.is_empty(); has_cfgs |= !cfgs.is_empty();
let section = util::link_section("data", core); let section = if local.shared && cfg!(feature = "heterogeneous") {
Some(quote!(#[rtfm::export::shared]))
} else {
util::link_section("data", core)
};
let expr = &local.expr; let expr = &local.expr;
let ty = &local.ty; let ty = &local.ty;
fields.push(quote!( fields.push(quote!(