From 87a9cb2d70896e6852e71ced6f4e2355b9521679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 30 Mar 2006 14:17:14 +0000 Subject: [PATCH] * No longer tries to start an application that doesn't export an entry point != NULL. This fixes bug #360. * Also removed no longer necessary undefining of _KERNEL_MODE, as we're now built correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16930 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/runtime_loader/rldelf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/system/runtime_loader/rldelf.c b/src/system/runtime_loader/rldelf.c index 88388618bc..dce3c24aaf 100644 --- a/src/system/runtime_loader/rldelf.c +++ b/src/system/runtime_loader/rldelf.c @@ -8,11 +8,6 @@ */ -// ToDo: this should not really be built with the kernel build rules... -#ifdef _KERNEL_MODE -# undef _KERNEL_MODE -#endif - #include #include @@ -970,7 +965,9 @@ load_container(char const *name, image_type type, const char *rpath, image_t **_ goto err3; } - image->entry_point = eheader.e_entry + image->regions[0].delta; + if (eheader.e_entry != NULL) + image->entry_point = eheader.e_entry + image->regions[0].delta; + image->type = type; register_image(image, fd, path); @@ -1202,6 +1199,11 @@ load_program(char const *path, void **_entry) remap_images(); // ToDo: once setup_system_time() is fixed, move this one line higher! + if (sProgramImage->entry_point == NULL) { + status = B_NOT_AN_EXECUTABLE; + goto err; + } + *_entry = (void *)(sProgramImage->entry_point); rld_unlock();