summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/frv
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/frv')
-rw-r--r--libc/sysdeps/linux/frv/Makefile4
-rw-r--r--libc/sysdeps/linux/frv/__init_brk.c6
-rw-r--r--libc/sysdeps/linux/frv/__longjmp.S8
-rw-r--r--libc/sysdeps/linux/frv/bits/uClibc_arch_features.h42
-rw-r--r--libc/sysdeps/linux/frv/brk.c13
-rw-r--r--libc/sysdeps/linux/frv/clone.S14
-rw-r--r--libc/sysdeps/linux/frv/crtreloc.c9
-rw-r--r--libc/sysdeps/linux/frv/dl-iterate-phdr.c3
-rw-r--r--libc/sysdeps/linux/frv/fstat.c47
-rw-r--r--libc/sysdeps/linux/frv/fstat64.c49
-rw-r--r--libc/sysdeps/linux/frv/link.h127
-rw-r--r--libc/sysdeps/linux/frv/lstat.c47
-rw-r--r--libc/sysdeps/linux/frv/lstat64.c49
-rw-r--r--libc/sysdeps/linux/frv/mmap.c6
-rw-r--r--libc/sysdeps/linux/frv/sbrk.c10
-rw-r--r--libc/sysdeps/linux/frv/stat.c47
-rw-r--r--libc/sysdeps/linux/frv/stat64.c49
-rw-r--r--libc/sysdeps/linux/frv/vfork.S3
18 files changed, 153 insertions, 380 deletions
diff --git a/libc/sysdeps/linux/frv/Makefile b/libc/sysdeps/linux/frv/Makefile
index 82d7ddf39..cfecfd9be 100644
--- a/libc/sysdeps/linux/frv/Makefile
+++ b/libc/sysdeps/linux/frv/Makefile
@@ -66,9 +66,5 @@ $(SOBJ): %.o : %.S
$(COBJ): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
-headers:
- $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/
-
clean:
$(RM) *.o *~ core
- $(RM) $(TOPDIR)/include/link.h
diff --git a/libc/sysdeps/linux/frv/__init_brk.c b/libc/sysdeps/linux/frv/__init_brk.c
index 92e07c49d..507902fc5 100644
--- a/libc/sysdeps/linux/frv/__init_brk.c
+++ b/libc/sysdeps/linux/frv/__init_brk.c
@@ -4,11 +4,16 @@
#include <unistd.h>
#include <sys/syscall.h>
+extern void * __curbrk;
+libc_hidden_proto(__curbrk)
void * __curbrk = 0;
+libc_hidden_data_def(__curbrk)
#define __NR__brk __NR_brk
attribute_hidden _syscall1(void *, _brk, void *, ptr);
+extern int __init_brk(void);
+libc_hidden_proto(__init_brk)
int
__init_brk (void)
{
@@ -23,3 +28,4 @@ __init_brk (void)
}
return 0;
}
+libc_hidden_def(__init_brk)
diff --git a/libc/sysdeps/linux/frv/__longjmp.S b/libc/sysdeps/linux/frv/__longjmp.S
index a61f8d4e0..c3145c84f 100644
--- a/libc/sysdeps/linux/frv/__longjmp.S
+++ b/libc/sysdeps/linux/frv/__longjmp.S
@@ -1,3 +1,9 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#define _SETJMP_H
#define _ASM
#include <bits/setjmp.h>
@@ -73,3 +79,5 @@ __longjmp:
ret
.Lend2:
.size __longjmp,.Lend2-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h b/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
new file mode 100644
index 000000000..ff0e20fad
--- /dev/null
+++ b/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
@@ -0,0 +1,42 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+/* instruction used when calling abort() to kill yourself */
+/*#define __UCLIBC_ABORT_INSTRUCTION__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target prefix all symbols with an _ ? */
+#define __UCLIBC_NO_UNDERSCORES__
+
+/* does your target have an asm .set ? */
+#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+
+/* define if target doesn't like .global */
+#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+
+/* define if target supports .weak */
+#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+
+/* define if target supports .weakext */
+#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+
+/* needed probably only for ppc64 */
+#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/libc/sysdeps/linux/frv/brk.c b/libc/sysdeps/linux/frv/brk.c
index d6063fc27..9e33830ab 100644
--- a/libc/sysdeps/linux/frv/brk.c
+++ b/libc/sysdeps/linux/frv/brk.c
@@ -1,15 +1,24 @@
/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
extern void * __curbrk;
+libc_hidden_proto(__curbrk)
extern int __init_brk (void);
+libc_hidden_proto(__init_brk)
extern void *_brk(void *ptr) attribute_hidden;
-int attribute_hidden __brk(void * end_data_seg)
+int brk(void * end_data_seg)
{
if (__init_brk () == 0)
{
@@ -20,4 +29,4 @@ int attribute_hidden __brk(void * end_data_seg)
}
return -1;
}
-strong_alias(__brk,brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/frv/clone.S b/libc/sysdeps/linux/frv/clone.S
index b714b45b1..145615734 100644
--- a/libc/sysdeps/linux/frv/clone.S
+++ b/libc/sysdeps/linux/frv/clone.S
@@ -20,15 +20,16 @@
/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
+#include <features.h>
#include <asm/unistd.h>
#define _ERRNO_H 1
#include <bits/errno.h>
.text
- .globl __clone
- .type __clone,@function
+ .globl clone
+ .type clone,@function
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
-__clone:
+clone:
/* Sanity check arguments. */
cmp.p gr8, gr0, icc0
cmp gr9, gr0, icc1
@@ -75,11 +76,8 @@ __clone:
breakpoints work.*/
mov.p gr17, gr15
- call _exit_internal
+ call HIDDEN_JUMPTARGET(_exit)
/* Should never get here. */
jmpl @(gr0, gr0)
- .size __clone,.-__clone
-
-.weak clone
- clone = __clone
+ .size clone,.-clone
diff --git a/libc/sysdeps/linux/frv/crtreloc.c b/libc/sysdeps/linux/frv/crtreloc.c
index 8d20e967e..1a86728a3 100644
--- a/libc/sysdeps/linux/frv/crtreloc.c
+++ b/libc/sysdeps/linux/frv/crtreloc.c
@@ -26,15 +26,12 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#define _GNU_SOURCE 1
#include <sys/types.h>
#include <link.h>
/* This file is to be compiled into crt object files, to enable
executables to easily self-relocate. */
-#define hidden __attribute__((__visibility__("hidden")))
-
/* Compute the runtime address of pointer in the range [p,e), and then
map the pointer pointed by it. */
inline static void ***
@@ -65,7 +62,7 @@ reloc_range_indirect (void ***p, void ***e,
/* Call __reloc_range_indirect for the given range except for the last
entry, whose contents are only relocated. It's expected to hold
the GOT value. */
-void* hidden
+void* attribute_hidden
__self_reloc (const struct elf32_fdpic_loadmap *map,
void ***p, void ***e)
{
@@ -96,7 +93,7 @@ reloc_range (void **p, void **e,
/* Remap p, adjust e by the same offset, then map the pointers in the
range determined by them. */
-void hidden
+void attribute_hidden
__reloc_range (const struct elf32_fdpic_loadmap *map,
void **p, void **e)
{
@@ -110,7 +107,7 @@ __reloc_range (const struct elf32_fdpic_loadmap *map,
/* Remap p, adjust e by the same offset, then map pointers referenced
by the (unadjusted) pointers in the range. Return the relocated
value of the last pointer in the range. */
-void* hidden
+void* attribute_hidden
__reloc_range_indirect (const struct elf32_fdpic_loadmap *map,
void ***p, void ***e)
{
diff --git a/libc/sysdeps/linux/frv/dl-iterate-phdr.c b/libc/sysdeps/linux/frv/dl-iterate-phdr.c
index ebb3b9c4a..144e4c145 100644
--- a/libc/sysdeps/linux/frv/dl-iterate-phdr.c
+++ b/libc/sysdeps/linux/frv/dl-iterate-phdr.c
@@ -16,10 +16,9 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#define _GNU_SOURCE
#include <link.h>
-extern int __attribute__((__weak__))
+extern int weak_function
__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
size_t size, void *data),
void *data);
diff --git a/libc/sysdeps/linux/frv/fstat.c b/libc/sysdeps/linux/frv/fstat.c
index ce6b68e66..a1d343cb8 100644
--- a/libc/sysdeps/linux/frv/fstat.c
+++ b/libc/sysdeps/linux/frv/fstat.c
@@ -1,45 +1,18 @@
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <endian.h>
-
+#include "../common/syscalls.h"
#include <unistd.h>
-#define _SYS_STAT_H
-#include <bits/stat.h>
+#include <sys/stat.h>
-#define __NR___syscall_fstat __NR_fstat
-_syscall2(int, __syscall_fstat, int, fd, struct stat *, buf);
-strong_alias(__syscall_fstat, fstat)
+libc_hidden_proto(fstat)
+_syscall2(int, fstat, int, fd, struct stat *, buf);
+libc_hidden_def(fstat)
diff --git a/libc/sysdeps/linux/frv/fstat64.c b/libc/sysdeps/linux/frv/fstat64.c
index 27000bf83..e07a28471 100644
--- a/libc/sysdeps/linux/frv/fstat64.c
+++ b/libc/sysdeps/linux/frv/fstat64.c
@@ -1,47 +1,20 @@
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <endian.h>
-
+#include "../common/syscalls.h"
#include <unistd.h>
-#define _SYS_STAT_H
-#include <bits/stat.h>
+#include <sys/stat.h>
-#if defined __UCLIBC_HAS_LFS__
-#define __NR___syscall_fstat64 __NR_fstat64
-_syscall2(int, __syscall_fstat64, int, fd, struct stat64 *, buf);
-strong_alias(__syscall_fstat64, fstat64)
+#ifdef __UCLIBC_HAS_LFS__
+libc_hidden_proto(fstat64)
+_syscall2(int, fstat64, int, fd, struct stat64 *, buf);
+libc_hidden_def(fstat64)
#endif
diff --git a/libc/sysdeps/linux/frv/link.h b/libc/sysdeps/linux/frv/link.h
deleted file mode 100644
index 121608f2b..000000000
--- a/libc/sysdeps/linux/frv/link.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Data structure for communication from the run-time dynamic linker for
- loaded ELF shared objects.
- Copyright (C) 1995-1999, 2000, 2001, 2004 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _LINK_H
-#define _LINK_H 1
-
-#include <features.h>
-#include <elf.h>
-#include <dlfcn.h>
-#include <sys/types.h>
-
-/* We use this macro to refer to ELF types independent of the native wordsize.
- `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
-#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
-#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
-#define _ElfW_1(e,w,t) e##w##t
-
-#include <bits/elfclass.h> /* Defines __ELF_NATIVE_CLASS. */
-
-/* Rendezvous structure used by the run-time dynamic linker to communicate
- details of shared object loading to the debugger. If the executable's
- dynamic section has a DT_DEBUG element, the run-time linker sets that
- element's value to the address where this structure can be found. */
-
-struct r_debug
- {
- int r_version; /* Version number for this protocol. */
-
- struct link_map *r_map; /* Head of the chain of loaded objects. */
-
- /* This is the address of a function internal to the run-time linker,
- that will always be called when the linker begins to map in a
- library or unmap it, and again when the mapping change is complete.
- The debugger can set a breakpoint at this address if it wants to
- notice shared object mapping changes. */
- ElfW(Addr) r_brk;
- enum
- {
- /* This state value describes the mapping change taking place when
- the `r_brk' address is called. */
- RT_CONSISTENT, /* Mapping change is complete. */
- RT_ADD, /* Beginning to add a new object. */
- RT_DELETE /* Beginning to remove an object mapping. */
- } r_state;
-
- ElfW(Addr) r_ldbase; /* Base address the linker is loaded at. */
- };
-
-/* This is the instance of that structure used by the dynamic linker. */
-extern struct r_debug _r_debug;
-
-/* This symbol refers to the "dynamic structure" in the `.dynamic' section
- of whatever module refers to `_DYNAMIC'. So, to find its own
- `struct r_debug', a program could do:
- for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
- if (dyn->d_tag == DT_DEBUG)
- r_debug = (struct r_debug *) dyn->d_un.d_ptr;
- */
-extern ElfW(Dyn) _DYNAMIC[];
-
-#ifdef __FRV_FDPIC__
-# include <bits/elf-fdpic.h>
-#endif
-
-/* Structure describing a loaded shared object. The `l_next' and `l_prev'
- members form a chain of all the shared objects loaded at startup.
-
- These data structures exist in space used by the run-time dynamic linker;
- modifying them may have disastrous results. */
-
-struct link_map
- {
- /* These first few members are part of the protocol with the debugger.
- This is the same format used in SVR4. */
-
-#ifdef __FRV_FDPIC__
- struct elf32_fdpic_loadaddr l_addr;
-#else
- ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
-#endif
- char *l_name; /* Absolute file name object was found in. */
- ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
- struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
- };
-
-#ifdef __USE_GNU
-
-struct dl_phdr_info
- {
-#ifdef __FRV_FDPIC__
- struct elf32_fdpic_loadaddr dlpi_addr;
-#else
- ElfW(Addr) dlpi_addr;
-#endif
- const char *dlpi_name;
- const ElfW(Phdr) *dlpi_phdr;
- ElfW(Half) dlpi_phnum;
- };
-
-__BEGIN_DECLS
-
-extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
- size_t size, void *data),
- void *data) __THROW;
-
-__END_DECLS
-
-#endif
-
-#endif /* link.h */
diff --git a/libc/sysdeps/linux/frv/lstat.c b/libc/sysdeps/linux/frv/lstat.c
index b9f0350c4..b178af76b 100644
--- a/libc/sysdeps/linux/frv/lstat.c
+++ b/libc/sysdeps/linux/frv/lstat.c
@@ -1,45 +1,18 @@
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <endian.h>
-
+#include "../common/syscalls.h"
#include <unistd.h>
-#define _SYS_STAT_H
-#include <bits/stat.h>
+#include <sys/stat.h>
-#define __NR___syscall_lstat __NR_lstat
-_syscall2(int, __syscall_lstat, const char *, file_name, struct stat *, buf);
-strong_alias(__syscall_lstat, lstat)
+libc_hidden_proto(lstat)
+_syscall2(int, lstat, const char *, file_name, struct stat *, buf);
+libc_hidden_def(lstat)
diff --git a/libc/sysdeps/linux/frv/lstat64.c b/libc/sysdeps/linux/frv/lstat64.c
index 8f9413a8d..9a6236b14 100644
--- a/libc/sysdeps/linux/frv/lstat64.c
+++ b/libc/sysdeps/linux/frv/lstat64.c
@@ -1,47 +1,20 @@
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <endian.h>
-
+#include "../common/syscalls.h"
#include <unistd.h>
-#define _SYS_STAT_H
-#include <bits/stat.h>
+#include <sys/stat.h>
-#if defined __UCLIBC_HAS_LFS__
-#define __NR___syscall_lstat64 __NR_lstat64
-_syscall2(int, __syscall_lstat64, const char *, file_name, struct stat64 *, buf);
-strong_alias(__syscall_lstat64, lstat64)
+#ifdef __UCLIBC_HAS_LFS__
+libc_hidden_proto(lstat64)
+_syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf);
+libc_hidden_def(lstat64)
#endif
diff --git a/libc/sysdeps/linux/frv/mmap.c b/libc/sysdeps/linux/frv/mmap.c
index fa801bb5f..d4cfcb062 100644
--- a/libc/sysdeps/linux/frv/mmap.c
+++ b/libc/sysdeps/linux/frv/mmap.c
@@ -29,6 +29,8 @@
#include <sys/syscall.h>
#include <sys/mman.h>
+libc_hidden_proto(mmap)
+
#define __NR___syscall_mmap2 __NR_mmap2
static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
size_t, len, int, prot, int, flags, int, fd, off_t, offset);
@@ -38,7 +40,7 @@ static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
# define MMAP2_PAGE_SHIFT 12
# endif
-__ptr_t attribute_hidden __mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
{
if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
__set_errno (EINVAL);
@@ -46,4 +48,4 @@ __ptr_t attribute_hidden __mmap(__ptr_t addr, size_t len, int prot, int flags, i
}
return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
}
-strong_alias(__mmap,mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/frv/sbrk.c b/libc/sysdeps/linux/frv/sbrk.c
index e9faf7db0..bb66f0148 100644
--- a/libc/sysdeps/linux/frv/sbrk.c
+++ b/libc/sysdeps/linux/frv/sbrk.c
@@ -4,13 +4,17 @@
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(sbrk)
+
extern void * __curbrk;
+libc_hidden_proto(__curbrk)
extern int __init_brk (void);
+libc_hidden_proto(__init_brk)
extern void *_brk(void *ptr) attribute_hidden;
-void attribute_hidden *
-__sbrk(intptr_t increment)
+void *
+sbrk(intptr_t increment)
{
if (__init_brk () == 0)
{
@@ -23,4 +27,4 @@ __sbrk(intptr_t increment)
}
return ((void *) -1);
}
-strong_alias(__sbrk,sbrk)
+libc_hidden_def(sbrk)
diff --git a/libc/sysdeps/linux/frv/stat.c b/libc/sysdeps/linux/frv/stat.c
index 4a54b130f..56cb668db 100644
--- a/libc/sysdeps/linux/frv/stat.c
+++ b/libc/sysdeps/linux/frv/stat.c
@@ -1,45 +1,18 @@
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <endian.h>
-
+#include "../common/syscalls.h"
#include <unistd.h>
-#define _SYS_STAT_H
-#include <bits/stat.h>
+#include <sys/stat.h>
-#define __NR___syscall_stat __NR_stat
-_syscall2(int, __syscall_stat, const char *, file_name, struct stat *, buf);
-strong_alias(__syscall_stat, stat)
+libc_hidden_proto(stat)
+_syscall2(int, stat, const char *, file_name, struct stat *, buf);
+libc_hidden_def(stat)
diff --git a/libc/sysdeps/linux/frv/stat64.c b/libc/sysdeps/linux/frv/stat64.c
index ecfe808cc..641644ffd 100644
--- a/libc/sysdeps/linux/frv/stat64.c
+++ b/libc/sysdeps/linux/frv/stat64.c
@@ -1,47 +1,20 @@
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <endian.h>
-
+#include "../common/syscalls.h"
#include <unistd.h>
-#define _SYS_STAT_H
-#include <bits/stat.h>
+#include <sys/stat.h>
-#if defined __UCLIBC_HAS_LFS__
-#define __NR___syscall_stat64 __NR_stat64
-_syscall2(int, __syscall_stat64, const char *, file_name, struct stat64 *, buf);
-strong_alias(__syscall_stat64, stat64)
+#ifdef __UCLIBC_HAS_LFS__
+libc_hidden_proto(stat64)
+_syscall2(int, stat64, const char *, file_name, struct stat64 *, buf);
+libc_hidden_def(stat64)
#endif
diff --git a/libc/sysdeps/linux/frv/vfork.S b/libc/sysdeps/linux/frv/vfork.S
index b5ecc09af..8935a12f8 100644
--- a/libc/sysdeps/linux/frv/vfork.S
+++ b/libc/sysdeps/linux/frv/vfork.S
@@ -43,4 +43,5 @@ __vfork:
.size __vfork,.-__vfork
-strong_alias(__vfork,vfork)
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)