link_section attribute misleadingly allowed on modules and impls #65128
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The
#[link_section]
attribute seems to be allowed on modules and impl blocks, but it will not do anything. I would expect either all functions/statics within the module/impl to be placed into the specified link_section, but this does not happen.Code used:
I've verified the functions are linked in and not just optimized out etc. As-is the functions will be placed into the default
.text
section, but if I uncomment the link_section attributes then they are properly placed in the.textaux1
section. No compiler errors or warnings are generatedrustc version:
rustc 1.40.0-nightly (2daa404 2019-10-02)
binary: rustc
commit-hash: 2daa404
commit-date: 2019-10-02
host: x86_64-apple-darwin
release: 1.40.0-nightly
LLVM version: 9.0
The text was updated successfully, but these errors were encountered: