summaryrefslogtreecommitdiff
path: root/libexec/ld.so/loader.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-06-01 09:20:59 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-06-01 09:20:59 +0000
commit062aa1547425e65e6b93796040ccb0999605b603 (patch)
treee1800cec2910db4fedac47960947177ba65933f8 /libexec/ld.so/loader.c
parentdaa9c455ce0f2d9b8edbf41447ead13cf0a8d5a4 (diff)
- Allocate space for the finishing NUL in the name of ld.so.
- some comments.
Diffstat (limited to 'libexec/ld.so/loader.c')
-rw-r--r--libexec/ld.so/loader.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 3322b2881a1..4804a9f5a66 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.12 2001/05/31 13:58:24 art Exp $ */
+/* $OpenBSD: loader.c,v 1.13 2001/06/01 09:20:58 art Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -220,7 +220,7 @@ _dl_printf("%p %p 0x%lx %p %p\n", argv, envp, loff, dynp, dl_data);
dl_data, OBJTYPE_EXE, 0, 0);
}
if(phdp->p_type == PT_INTERP) {
- us = (char *)_dl_malloc(_dl_strlen((char *)phdp->p_vaddr));
+ us = (char *)_dl_malloc(_dl_strlen((char *)phdp->p_vaddr) + 1);
_dl_strcpy(us, (char *)phdp->p_vaddr);
}
phdp++;
@@ -295,7 +295,7 @@ _dl_printf("%p %p 0x%lx %p %p\n", argv, envp, loff, dynp, dl_data);
/*
* Finally make something to help gdb when poking around in the code.
*/
-#ifdef __powerpc__
+#if defined(__powerpc__) || defined(__alpha__)
{
int done = 0;
@@ -615,6 +615,7 @@ _dl_rtld(elf_object_t *object)
_dl_md_reloc(object, DT_REL, DT_RELSZ);
_dl_md_reloc(object, DT_RELA, DT_RELASZ);
#if defined(__alpha__)
+ /* We assume that DT_PTREL is DT_RELA */
_dl_md_reloc(object, DT_JMPREL, DT_PLTRELSZ);
#endif
if(_dl_bindnow) { /* XXX Perhaps more checking ? */