From 5a23dcc80b79e4ac76a28f8b34000c84937890cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 26 Jun 2004 02:15:48 +0000 Subject: [PATCH] find_image_at_address() now also takes the data section into account, so that you can now also look up symbols in there. load_kernel_add_on() now sets the text section read-only & execute after having loaded the area - note, it currently doesn't have any effect anyway :) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8173 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/elf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/kernel/core/elf.c b/src/kernel/core/elf.c index 72288ef34f..f09b7042e7 100644 --- a/src/kernel/core/elf.c +++ b/src/kernel/core/elf.c @@ -127,8 +127,10 @@ find_image_at_address(addr_t address) // get image that may contain the address while ((image = hash_next(sImagesHash, &iterator)) != NULL) { - if (address >= image->text_region.start - && address <= (image->text_region.start + image->text_region.size)) + if ((address >= image->text_region.start + && address <= (image->text_region.start + image->text_region.size)) + || (address >= image->data_region.start + && address <= (image->data_region.start + image->data_region.size))) break; } @@ -1354,8 +1356,8 @@ load_kernel_add_on(const char *path) goto error5; // We needed to read in the contents of the "text" area, but - // now we can protect it read-only - set_area_protection(image->text_region.id, B_KERNEL_READ_AREA); + // now we can protect it read-only/execute + set_area_protection(image->text_region.id, B_KERNEL_READ_AREA | B_KERNEL_EXECUTE_AREA); // ToDo: this should be enabled by kernel settings! if (1)