Repository: aya-rs/aya (language: rust)

Issue:
`#[map(name = "foobar")]` macro doesn't behave as expected
It's defined as:

```rust
    pub fn expand(&self) -> Result<TokenStream> {
        let section_name = "maps".to_string();
        let name = &self.name;
        let item = &self.item;
        Ok(quote! {
            #[no_mangle]
            #[link_section = #section_name]
            #[export_name = #name]
            #item
        })
    }
```

But something like:

```rust
#[map(name = "anycast_v4_subnets")]
static mut ANYCAST_V4_SUBNETS: LpmTrie<SubnetIpv4Key, u8> = LpmTrie::pinned(512, BPF_F_NO_PREALLOC);
```

Actually gives a program file with the uppercase name:

![image](https://user-images.githubusercontent.com/7998310/169555699-a2aabe56-df65-4cdd-aed9-91da924d759c.png)

After some discord discussion, we started suspecting that `#[no_mangle]` was the guilty party here, and indeed a PR follows that shows that it this is the case.


Discussion / hints:

Fix patch:
diff --git a/bpf/aya-bpf-macros/src/expand.rs b/bpf/aya-bpf-macros/src/expand.rs
index df628711b..778771403 100644
--- a/bpf/aya-bpf-macros/src/expand.rs
+++ b/bpf/aya-bpf-macros/src/expand.rs
@@ -97,7 +97,6 @@ impl Map {
         let name = &self.name;
         let item = &self.item;
         Ok(quote! {
-            #[no_mangle]
             #[link_section = #section_name]
             #[export_name = #name]
             #item


Test patch: