Author: jhb
Date: Tue Feb  6 17:01:10 2018
New Revision: 328939
URL: https://svnweb.freebsd.org/changeset/base/328939

Log:
  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

Modified:
  head/contrib/gcc/config/mips/mips.h

Modified: head/contrib/gcc/config/mips/mips.h
==============================================================================
--- head/contrib/gcc/config/mips/mips.h Tue Feb  6 16:02:33 2018        
(r328938)
+++ head/contrib/gcc/config/mips/mips.h Tue Feb  6 17:01:10 2018        
(r328939)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to