From fb84029beef9bec3c205583296b181023f2e4b6b Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 11 Jul 2019 12:53:58 +0200 Subject: [PATCH] implement the #[shared] attribute as specified in RFC #211 --- macros/src/codegen/locals.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/macros/src/codegen/locals.rs b/macros/src/codegen/locals.rs index 799ef7a0ad..cbfe05fbb9 100644 --- a/macros/src/codegen/locals.rs +++ b/macros/src/codegen/locals.rs @@ -42,7 +42,11 @@ pub fn codegen( let cfgs = &local.cfgs; 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 ty = &local.ty; fields.push(quote!(