Skip to content

Commit

Permalink
Turn _mcount() into a call to abort() on MIPS n64
Browse files Browse the repository at this point in the history
When linking world with LLD it will complain about undefined references
to _mcount. For some reason the _mcount function definition will end
up in the .mdebug.abi section and therefore the linker won't find it.

This change should be fine because the inline assembly below won't work
for N64 anyway.
  • Loading branch information
arichardson committed Aug 9, 2017
1 parent f863a7d commit 0f80091
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sys/mips/include/profile.h
Expand Up @@ -42,7 +42,10 @@
/*XXX The cprestore instruction is a "dummy" to shut up as(1). */

/*XXX This is not MIPS64 safe. */

#ifdef __mips_n64
/* XXXAR: not implemented for mips n64 */
#define MCOUNT void _mcount(uintfptr_t frompc, uintfptr_t selfpc) { abort(); }
#else
#define MCOUNT \
__asm(".globl _mcount;" \
".type _mcount,@function;" \
Expand Down Expand Up @@ -71,7 +74,7 @@
"move $31,$1;" \
".set reorder;" \
".set at");

#endif
#ifdef _KERNEL
/*
* The following two macros do splhigh and splx respectively.
Expand Down

0 comments on commit 0f80091

Please sign in to comment.