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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251843 138bc75d-0d04-0410-961f-82ee72b054a4