[uClibc-cvs] uClibc/ldso/ldso/frv dl-syscalls.h, 1.2, 1.3 dl-sysdep.h, 1.2, 1.3
Erik Andersen
andersen at uclibc.org
Fri May 14 10:59:11 UTC 2004
Update of /var/cvs/uClibc/ldso/ldso/frv
In directory nail:/tmp/cvs-serv22500/ldso/ldso/frv
Modified Files:
dl-syscalls.h dl-sysdep.h
Log Message:
Alexandre Oliva writes:
Here are a number of minor changes to FR-V-specific bits of the uClibc
port:
- I've adjusted the definition of _dl_mmap to cope with the fact that
there will be a definition for an mmap2-only system.
- We don't have COPY relocs, so optimize the copy reloc-related code
away.
- Change the page size to 16KiB, to match the ABI spec, and not a
stale value I'd copied from a linker config file. Oops.
- Fix error handling in clone and vfork; parts of the changes by David
Howells <dhowells at redhat.com>
- Rearrange includes in crtreloc.c.
- Change the API of __syscall_error, to reduce code size.
- Improve __syscall_return in terms of code size, so as to enable
tail-calling of __syscall_error, at least within libc. Ideally,
__syscall_error should be hidden within libc.so, but this didn't
work because of libdl. I haven't looked into why, and figured I'd
leave it visible for now.
- Rename enumerators and macros in sys/ucontext.h to reduce namespace
pollution.
Index: dl-sysdep.h
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/frv/dl-sysdep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/dl-sysdep.h 18 Feb 2004 08:12:30 -0000 1.2
+++ b/dl-sysdep.h 14 May 2004 10:59:09 -0000 1.3
@@ -29,6 +29,8 @@
*/
#undef ELF_USES_RELOCA
+#define DL_NO_COPY_RELOCS
+
/*
* Initialization sequence for a GOT. Copy the resolver function
* descriptor and the pointer to the elf_resolve/link_map data
@@ -62,10 +64,11 @@
#define do_rem(result, n, base) result = (n % base)
-/* 4096 bytes alignment */
-#define PAGE_ALIGN 0xfffff000
-#define ADDR_ALIGN 0xfff
-#define OFFS_ALIGN 0x7ffff000
+/* 16KiB page alignment. Should perhaps be made dynamic using
+ getpagesize(), based on AT_PAGESZ from auxvt? */
+#define PAGE_ALIGN 0xffffc000
+#define ADDR_ALIGN 0x3fff
+#define OFFS_ALIGN 0x7fffc000
struct funcdesc_ht;
Index: dl-syscalls.h
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/frv/dl-syscalls.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/dl-syscalls.h 12 May 2004 22:54:51 -0000 1.2
+++ b/dl-syscalls.h 14 May 2004 10:59:09 -0000 1.3
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Red Hat, Inc.
+/* Copyright (C) 2003, 2004 Red Hat, Inc.
Contributed by Alexandre Oliva <aoliva at redhat.com>
This file is part of uClibc.
@@ -27,28 +27,28 @@
/* The code below is extracted from libc/sysdeps/linux/frv/_mmap.c */
+#if DYNAMIC_LOADER_IN_SIMULATOR
#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);
+/* Make sure we don't get another definition of _dl_mmap from the
+ machine-independent code. */
+#undef __NR_mmap
+#undef __NR_mmap2
+
/* This is always 12, even on architectures where PAGE_SHIFT != 12. */
# ifndef MMAP2_PAGE_SHIFT
# define MMAP2_PAGE_SHIFT 12
# endif
-#if DYNAMIC_LOADER_IN_SIMULATOR
#include <asm/page.h> /* for PAGE_SIZE */
inline static void *_dl_memset(void*,int,size_t);
inline static ssize_t _dl_pread(int fd, void *buf, size_t count, off_t offset);
-#endif
-#ifndef DYNAMIC_LOADER_IN_SIMULATOR
-inline
-#endif
static __ptr_t
_dl_mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
{
-#ifdef DYNAMIC_LOADER_IN_SIMULATOR
size_t plen = (len + PAGE_SIZE - 1) & -PAGE_SIZE;
/* This is a hack to enable the dynamic loader to run within a
@@ -128,14 +128,12 @@
flags |= MAP_FIXED;
addr = ret;
}
-#endif
if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
#if 0
__set_errno (EINVAL);
#endif
return MAP_FAILED;
}
-#ifdef DYNAMIC_LOADER_IN_SIMULATOR
if ((flags & MAP_FIXED) != 0)
{
if (_dl_pread(fd, addr, len, offset) != (ssize_t)len)
@@ -144,9 +142,9 @@
_dl_memset (addr + len, 0, plen - len);
return addr;
}
-#endif
return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
}
+#endif
#ifdef __NR_pread
#ifdef DYNAMIC_LOADER_IN_SIMULATOR
More information about the uClibc-cvs
mailing list