HomePhabricator

[mips] Switch to the `.text` section after emitting asm file preamble

Description

[mips] Switch to the .text section after emitting asm file preamble

Now the last .section directive in the MIPS asm file preamble
is the .section .mdebug.abi. If assembler code injected for example
by the LLVM module asm or the C __asm directives do not contain
explicit switching to the .text section it goes to the .mdebug.abi
section. It might be unexpected to the user and in fact for example
breaks building some existing code like FreeBSD libc [1].

The patch forces switching to the .text section after emitting MIPS
assembler file preamble.

[1] https://bugs.llvm.org/show_bug.cgi?id=43119

Fix PR43119.

Differential Revision: https://reviews.llvm.org/D67014