• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by John Dev


11 Jan, 2025

Updated at 20 Jan, 2025

Are `link_section` values that start with dot not allowed?

I've been experimenting and noticed that while this works and results in ELF section when applied to a static:

#[used]
#[unsafe(link_section = "TEST")]

This does not, corresponding section is simply missing in the binary:

#[used]
#[unsafe(link_section = ".TEST")]

It is possible to add with inline assembly, but not like ^ directly.

I have not been able to find any Rust issues about this or anything on the forum or elsewhere that would explain this behavior, there was also no warnings or anything like that generated by the compiler.

Does anyone know why this is happening?

3 posts - 2 participants

Read full topic