summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-14 10:59:09 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-14 10:59:09 +0000
commit297b6bb585320c9ee650258fb3d3e7e812cdc5a8 (patch)
tree5f2ef14066df9438b6fae31b949a03b5f82cf356 /ldso
parentcd411309b5af27b1a02f324174d1caad98bc0927 (diff)
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@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.
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/frv/dl-syscalls.h18
-rw-r--r--ldso/ldso/frv/dl-sysdep.h11
2 files changed, 15 insertions, 14 deletions
diff --git a/ldso/ldso/frv/dl-syscalls.h b/ldso/ldso/frv/dl-syscalls.h
index b51a78a79..3cfe2d7b1 100644
--- a/ldso/ldso/frv/dl-syscalls.h
+++ b/ldso/ldso/frv/dl-syscalls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Red Hat, Inc.
+/* Copyright (C) 2003, 2004 Red Hat, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of uClibc.
@@ -27,28 +27,28 @@ extern int _dl_errno;
/* 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 @@ _dl_mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
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_mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
_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
diff --git a/ldso/ldso/frv/dl-sysdep.h b/ldso/ldso/frv/dl-sysdep.h
index e0faf89ed..46f8461f7 100644
--- a/ldso/ldso/frv/dl-sysdep.h
+++ b/ldso/ldso/frv/dl-sysdep.h
@@ -29,6 +29,8 @@ USA. */
*/
#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 @@ extern int _dl_linux_resolve(void) __attribute__((__visibility__("hidden")));
#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;