diff options
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/frv/dl-syscalls.h | 18 | ||||
-rw-r--r-- | ldso/ldso/frv/dl-sysdep.h | 11 |
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; |