aboutsummaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-06-08 09:00:23 +0000
committerRoland McGrath <roland@gnu.org>1995-06-08 09:00:23 +0000
commit5bf62f2d3a8af353fac661b224fc1604d4de51ea (patch)
treed71b6ad14564a99917f2d4133a8685df94d24c61 /hurd
parent75598ca67e469359c3c0b6b8704dae17bf2b9d89 (diff)
downloadglibc-5bf62f2d3a8af353fac661b224fc1604d4de51ea.zip
glibc-5bf62f2d3a8af353fac661b224fc1604d4de51ea.tar.gz
glibc-5bf62f2d3a8af353fac661b224fc1604d4de51ea.tar.bz2
Thu Jun 8 02:50:26 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* elf/rtld.c [! NDEBUG] (__assert_perror_fail): New function. * hurd/hurdstartup.c (_hurd_startup): Fancier kludge to guess phdr and user entry point addresses. * elf/dl-load.c (open_path): Don't do strlen on DIRPATH if it's null. (_dl_map_object): DT_RPATH value is relative to DT_STRTAB value. * Makerules (install-lib.so): Don't include libc.so. [$(build-shared)=yes] (install): Depend on the installed libc.so file. [$(build-shared)=yes] (install-no-libc.a): Make this, rather than install, depend on the installed $(install-lib.so) files. [$(build-shared)=yes] (install-lib.so): Append libc.so after that rule. * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Add kludge to allocate high addresses to avoid random mappings appearing there. (mmap): Comment out mask; always pass zero. Tue Jun 6 13:34:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * sysdeps/i386/dl-machine.h (ELF_MACHINE_USER_ADDRESS_MASK): New macro. * sysdeps/mach/hurd/dl-sysdep.c (mmap): Use it as mask in vm_map call. * elf/dl-error.c (_dl_catch_error): Clear *ERRSTRING and *OBJNAME when successful. * sysdeps/mach/hurd/dl-sysdep.c (threadvars): New static variable. (__hurd_threadvar_max, __hurd_threadvar_stack_offset): Define these variables, using the `threadvars' buffer. * elf/dl-reloc.c: Don't dereference L->l_prev when it's null. * sysdeps/i386/dl-runtime.c: Likewise. * elf/rtld.c (dl_main): Add missing NULL terminating argument in _dl_sysdep_fatal call. (__assert_fail): Likewise. * locale/Makefile (localedef-modules): Renamed ctype to locale-ctype so as not to conflict with the object file for ctype/ctype.c in the build directory. * sysdeps/i386/dl-machine.h (elf_machine_rel): If MAP->l_type is lt_interpreter, first undo relocation done during bootstrapping.
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdstartup.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/hurd/hurdstartup.c b/hurd/hurdstartup.c
index 416cddb..61b8cdf 100644
--- a/hurd/hurdstartup.c
+++ b/hurd/hurdstartup.c
@@ -158,33 +158,29 @@ _hurd_startup (void **argptr, void (*main) (int *data))
{
struct hurd_startup_data *d = (void *) &envp[envc + 1];
- /* XXX hardcoded until exec_startup changes */
-#ifdef PIC
-#if 0
- const Elf32_Ehdr *ehdr = (const void *) 0x08000000;
- vm_address_t phdr = 0x08000000 + ehdr->e_phoff;
- vm_size_t phdrsz = ehdr->e_phnum * ehdr->e_phentsize;
- vm_address_t user_entry = ehdr->e_entry;
-#else
- vm_address_t phdr = 0;
- vm_size_t phdrsz = 0;
-extern void _start();
- vm_address_t user_entry = (vm_address_t) &_start;
-#endif
-#else
- vm_address_t phdr = 0;
- vm_size_t phdrsz = 0;
- vm_address_t user_entry = 0;
-#endif
-
if ((void *) d != argv[0])
{
*d = data;
_hurd_init_dtable = d->dtable;
_hurd_init_dtablesize = d->dtablesize;
- d->phdr = phdr;
- d->phdrsz = phdrsz;
- d->user_entry = user_entry;
+
+ /* XXX hardcoded kludge until exec_startup changes */
+ {
+ extern void _start();
+ vm_address_t page = 0;
+ vm_size_t size = 0;
+ if (__vm_read (__mach_task_self (),
+ 0x08000000, __vm_page_size, &page, &size) == 0)
+ {
+ const Elf32_Ehdr *ehdr = (const void *) 0x08000000;
+ d->phdr = 0x08000000 + ehdr->e_phoff;
+ d->phdrsz = ehdr->e_phnum * ehdr->e_phentsize;
+ d->user_entry = ehdr->e_entry;
+ __vm_deallocate (__mach_task_self (), page, size);
+ }
+ else
+ d->user_entry = (Elf32_Addr) &_start;
+ }
}
(*main) (argcptr);