diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-09-07 13:20:40 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-09-07 13:20:40 +0200 |
commit | 86373d9214e40b5a05b1469da4b7a1d92b4a60fc (patch) | |
tree | e19f3204ac224f9a848867cd139c2f2267adc1ab /gcc/varasm.c | |
parent | ed323421344929d7b6104566d8301ce4f88fd00c (diff) | |
download | gcc-86373d9214e40b5a05b1469da4b7a1d92b4a60fc.zip gcc-86373d9214e40b5a05b1469da4b7a1d92b4a60fc.tar.gz gcc-86373d9214e40b5a05b1469da4b7a1d92b4a60fc.tar.bz2 |
re PR target/81979 (Assembler messages: Error: can't resolve `.got2' {.got2 section} - `.LCF0' {.text.unlikely section})
PR target/81979
* output.h (switch_to_other_text_partition): New declaration.
* varasm.c (switch_to_other_text_partition): New function.
* config/rs6000/rs6000.c (uses_TOC): Return 2 if
NOTE_INSN_SWITCH_TEXT_SECTIONS is seen before finding load_toc_* insn.
(rs6000_elf_declare_function_name): If uses_TOC returned 2, switch
to the other text partition before emitting LCL label and switch back
after emitting the word after it.
* gcc.dg/pr81979.c: New test.
From-SVN: r251843
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 6177eec..a7dca89 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -695,6 +695,16 @@ unlikely_text_section_p (section *sect) return sect == function_section_1 (current_function_decl, true); } +/* Switch to the other function partition (if inside of hot section + into cold section, otherwise into the hot section). */ + +void +switch_to_other_text_partition (void) +{ + in_cold_section_p = !in_cold_section_p; + switch_to_section (current_function_section ()); +} + /* Return the read-only data section associated with function DECL. */ section * |