From 6cd48015393b65bdabf33a43c76fb88fccab5af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 18 Aug 2004 00:22:57 +0000 Subject: [PATCH] Just to be on the safe side: no longer tries to load non-loadable segments. Improved error output in case something goes wrong. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8598 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/elf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kernel/core/elf.c b/src/kernel/core/elf.c index 15ab90d139..8d2318e592 100644 --- a/src/kernel/core/elf.c +++ b/src/kernel/core/elf.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -1074,6 +1073,9 @@ elf_load_user_image(const char *path, struct team *p, int flags, addr_t *entry) char *regionAddress; region_id id; + if (pheaders[i].p_type != PT_LOAD) + continue; + regionAddress = (char *)ROUNDOWN(pheaders[i].p_vaddr, PAGE_SIZE); if (pheaders[i].p_flags & PF_WRITE) { /* @@ -1094,7 +1096,7 @@ elf_load_user_image(const char *path, struct team *p, int flags, addr_t *entry) B_READ_AREA | B_WRITE_AREA, REGION_PRIVATE_MAP, path, ROUNDOWN(pheaders[i].p_offset, PAGE_SIZE)); if (id < 0) { - dprintf("error allocating region!\n"); + dprintf("error allocating region: %s!\n", strerror(id)); err = B_NOT_AN_EXECUTABLE; goto error; }