Use a workaround to compile the crt init functions correctly with clang.

The MIPS assembly parser treats forward-declared local symbols as global
symbols.  This results in CALL16 relocations being used against local
(private) symbols which then fail to resolve when linking binaries.
Add .local to force the init and fini functions to be treated as local as
a workaround.

Submitted by:	sbruno
Sponsored by:	DARPA / AFRL
This commit is contained in:
John Baldwin 2018-02-06 17:01:10 +00:00
parent 0d02f6c201
commit a1d39c5344

View File

@ -2721,6 +2721,7 @@ while (0)
nop\n\
1: .cpload $31\n\
.set reorder\n\
.local " USER_LABEL_PREFIX #FUNC "\n\
jal " USER_LABEL_PREFIX #FUNC "\n\
" TEXT_SECTION_ASM_OP);
#endif /* Switch to #elif when we're no longer limited by K&R C. */
@ -2733,6 +2734,7 @@ while (0)
nop\n\
1: .set reorder\n\
.cpsetup $31, $2, 1b\n\
.local " USER_LABEL_PREFIX #FUNC "\n\
jal " USER_LABEL_PREFIX #FUNC "\n\
" TEXT_SECTION_ASM_OP);
#endif