/* Special .init and .fini section support for MIPS (n64).
- Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#include <libc-symbols.h>
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
#ifndef PREINIT_FUNCTION
# define PREINIT_FUNCTION __gmon_start__
#endif
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
daddiu $sp,$sp,-16
ld $2,%got_disp(PREINIT_FUNCTION)($28)
beq $2,$0,.Lno_weak_fn
ld $25,%call16(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
.Lno_weak_fn:
+ .insn
#else
ld $25,%got_disp(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
#endif
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
daddiu $sp,$sp,-16