https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98146
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <h...@gcc.gnu.org>: https://gcc.gnu.org/g:2a976020603589e897fcfa3276590ef50b489d34 commit r11-6141-g2a976020603589e897fcfa3276590ef50b489d34 Author: H.J. Lu <hjl.to...@gmail.com> Date: Thu Dec 3 15:39:59 2020 -0800 Warn used and not used symbols in section with the same name When SECTION_RETAIN is used, issue a warning when a symbol without used attribute and a symbol with used attribute are placed in the section with the same name, like int __attribute__((used,section(".data.foo"))) foo2 = 2; int __attribute__((section(".data.foo"))) foo1 = 1; since assembler will put them in different sections with the same section name. gcc/ PR target/98146 * varasm.c (switch_to_section): Warn when a symbol without used attribute and a symbol with used attribute are placed in the section with the same name. gcc/testsuite/ PR target/98146 * c-c++-common/attr-used-5.c: Updated. * c-c++-common/attr-used-6.c: Likewise. * c-c++-common/attr-used-7.c: Likewise. * c-c++-common/attr-used-8.c: Likewise.