summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldso/ldso/mips/elfinterp.c12
-rw-r--r--libc/sysdeps/linux/mips/Makefile.arch6
-rw-r--r--libc/sysdeps/linux/mips/clone.S2
-rw-r--r--libc/sysdeps/linux/mips/sys/asm.h16
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-__syscall_rt_sigaction.c1
6 files changed, 31 insertions, 8 deletions
diff --git a/ldso/ldso/mips/elfinterp.c b/ldso/ldso/mips/elfinterp.c
index 427bff155..893c94c25 100644
--- a/ldso/ldso/mips/elfinterp.c
+++ b/ldso/ldso/mips/elfinterp.c
@@ -55,7 +55,7 @@ unsigned long __dl_runtime_resolve(unsigned long sym_index,
symname = strtab + sym->st_name;
new_addr = (unsigned long) _dl_find_hash(symname,
- tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
+ tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL);
if (unlikely(!new_addr)) {
_dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
_dl_progname, symname);
@@ -144,8 +144,8 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt,
struct elf_resolve *tpnt_tls = tpnt;
if (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_LOCAL) {
- _dl_find_hash2((strtab + symtab[symtab_index].st_name),
- _dl_symbol_tables, NULL, 1, &sym_tls, &tpnt_tls);
+ _dl_find_hash((strtab + symtab[symtab_index].st_name),
+ _dl_symbol_tables, tpnt_tls, 1, &sym_tls);
}
switch (reloc_type)
@@ -259,12 +259,12 @@ void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy)
}
else {
*got_entry = (unsigned long) _dl_find_hash(strtab +
- sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
+ sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL);
}
}
else if (sym->st_shndx == SHN_COMMON) {
*got_entry = (unsigned long) _dl_find_hash(strtab +
- sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
+ sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL);
}
else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC &&
*got_entry != sym->st_value && tmp_lazy) {
@@ -276,7 +276,7 @@ void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy)
}
else {
*got_entry = (unsigned long) _dl_find_hash(strtab +
- sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
+ sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL);
}
got_entry++;
diff --git a/libc/sysdeps/linux/mips/Makefile.arch b/libc/sysdeps/linux/mips/Makefile.arch
index da5ca1e0f..8edd83516 100644
--- a/libc/sysdeps/linux/mips/Makefile.arch
+++ b/libc/sysdeps/linux/mips/Makefile.arch
@@ -7,9 +7,13 @@
CSRC := \
__longjmp.c brk.c setjmp_aux.c mmap.c __syscall_error.c \
- cacheflush.c pread_write.c sysmips.c _test_and_set.c sigaction.c \
+ cacheflush.c pread_write.c sysmips.c _test_and_set.c \
readahead.c posix_fadvise.c posix_fadvise64.c
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+CSRC += sigaction.c
+endif
+
SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S pipe.S
ARCH_HEADERS := sgidefs.h
diff --git a/libc/sysdeps/linux/mips/clone.S b/libc/sysdeps/linux/mips/clone.S
index 716cd993f..40caf18e0 100644
--- a/libc/sysdeps/linux/mips/clone.S
+++ b/libc/sysdeps/linux/mips/clone.S
@@ -125,3 +125,5 @@ __thread_start:
move a0,v0
jal HIDDEN_JUMPTARGET(_exit)
.end __thread_start
+weak_alias(clone, __clone)
+
diff --git a/libc/sysdeps/linux/mips/sys/asm.h b/libc/sysdeps/linux/mips/sys/asm.h
index 76f6af3e1..a339f7de3 100644
--- a/libc/sysdeps/linux/mips/sys/asm.h
+++ b/libc/sysdeps/linux/mips/sys/asm.h
@@ -470,4 +470,20 @@ symbol = value
# define MTC0 dmtc0
#endif
+/* The MIPS archtectures do not have a uniform memory model. Particular
+ platforms may provide additional guarantees - for instance, the R4000
+ LL and SC instructions implicitly perform a SYNC, and the 4K promises
+ strong ordering.
+
+ However, in the absence of those guarantees, we must assume weak ordering
+ and SYNC explicitly where necessary.
+
+ Some obsolete MIPS processors may not support the SYNC instruction. This
+ applies to "true" MIPS I processors; most of the processors which compile
+ using MIPS I implement parts of MIPS II. */
+
+#ifndef MIPS_SYNC
+# define MIPS_SYNC sync
+#endif
+
#endif /* sys/asm.h */
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
index b5a21342b..59759f0dd 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
@@ -6,7 +6,7 @@
#
libpthread_SSRC = pt-vfork.S
-libpthread_CSRC = pthread_once.c
+libpthread_CSRC = pthread_once.c pt-__syscall_rt_sigaction.c
libc_a_CSRC = fork.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-__syscall_rt_sigaction.c b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-__syscall_rt_sigaction.c
new file mode 100644
index 000000000..50137c84a
--- /dev/null
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-__syscall_rt_sigaction.c
@@ -0,0 +1 @@
+#include <../../../../../../../libc/sysdeps/linux/common/__syscall_rt_sigaction.c>