diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-12-03 11:01:06 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-12-16 05:40:57 -0800 |
commit | 6175383249143309fdc780a02bea484f4450def7 (patch) | |
tree | 8a91ba4ed7888a01e7748bf51d5058126d41e210 /gcc/output.h | |
parent | ab9bd93271061f436c10e35e261ecb73e2108ccc (diff) | |
download | gcc-6175383249143309fdc780a02bea484f4450def7.zip gcc-6175383249143309fdc780a02bea484f4450def7.tar.gz gcc-6175383249143309fdc780a02bea484f4450def7.tar.bz2 |
Switch to a new section if the SECTION_RETAIN bit doesn't match
When definitions marked with used attribute and unmarked definitions are
placed in the section with the same name, switch to a new section if the
SECTION_RETAIN bit doesn't match.
gcc/
PR target/98146
* output.h (switch_to_section): Add a tree argument, default to
nullptr.
* varasm.c (get_section): If the SECTION_RETAIN bit doesn't match,
return and switch to a new section later.
(assemble_start_function): Pass decl to switch_to_section.
(assemble_variable): Likewise.
(switch_to_section): If the SECTION_RETAIN bit doesn't match,
switch to a new section.
gcc/testsuite/
PR target/98146
* c-c++-common/attr-used-5.c: New test.
* c-c++-common/attr-used-6.c: Likewise.
* c-c++-common/attr-used-7.c: Likewise.
* c-c++-common/attr-used-8.c: Likewise.
* c-c++-common/attr-used-9.c: Likewise.
Diffstat (limited to 'gcc/output.h')
-rw-r--r-- | gcc/output.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/output.h b/gcc/output.h index fa8ace1..1f9af46 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -548,7 +548,7 @@ extern void switch_to_other_text_partition (void); extern section *get_cdtor_priority_section (int, bool); extern bool unlikely_text_section_p (section *); -extern void switch_to_section (section *); +extern void switch_to_section (section *, tree = nullptr); extern void output_section_asm_op (const void *); extern void record_tm_clone_pair (tree, tree); |