util/attributes: error on malformed #[link_section] input#4357
Merged
P-E-P merged 1 commit intoRust-GCC:masterfrom Jan 12, 2026
Merged
util/attributes: error on malformed #[link_section] input#4357P-E-P merged 1 commit intoRust-GCC:masterfrom
P-E-P merged 1 commit intoRust-GCC:masterfrom
Conversation
85fc427 to
cf7149c
Compare
Contributor
Author
|
drafted to resolve merge conflicts |
Contributor
Author
|
no merge conflicts , pr ready for review . @P-E-P please review thankyou . |
a13b45c to
ffb73a4
Compare
P-E-P
requested changes
Jan 9, 2026
0be2b5b to
35a0548
Compare
Emit a diagnostic when #[link_section] is used without arguments on functions or static items, matching rustc behavior. This prevents silent acceptance of empty attributes and provides a helpful diagnostic that shows the expected form. Fixes Rust-GCC#4229 gcc/rust/ChangeLog: * util/rust-attributes.cc (check_link_section_attribute): New helper. (AttributeChecker::visit): Check link_section on functions and statics. gcc/testsuite/ChangeLog: * rust/compile/link_section-malformed.rs: New test. Signed-off-by: Jayant Chauhan <0001jayant@gmail.com>
35a0548 to
cc9081c
Compare
Contributor
Author
|
I introduced a helper function , did requested changes . thnakyou |
P-E-P
approved these changes
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emit a diagnostic when #[link_section] is used without arguments, matching rustc behavior. This prevents silent acceptance of empty attributes and provides a helpful diagnostic that shows the expected form.
Fixes #4229
gcc/rust/ChangeLog:
gcc/testsuite/ChangeLog: