https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98121
Bug ID: 98121 Summary: __attribute__ ((used)) should not imply SHF_RETAIN_SECTION Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: fw at gcc dot gnu.org Target Milestone: --- The used attribute has already a defined meaning. I think it's wrong to cause it to change section attributes because people use it to interface with assembler code, so section flags conflicts are rather likely. Using a separate attribute would also avoid the need for the configure check in GCC. This is related to this commit (note the date is off, it's actually GCC 11 only): commit 6fbec038f7a7ddf29f074943611b53210d17c40c Author: H.J. Lu <hjl.to...@gmail.com> Date: Mon Feb 3 11:55:43 2020 -0800 Use SHF_GNU_RETAIN to preserve symbol definitions