Remap all preloaded executables read-only and executable.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19180 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-11-02 20:38:30 +00:00
parent 5718fbb92c
commit 0ad660a168
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -820,6 +820,10 @@ insert_preloaded_image(struct preloaded_image *preloadedImage, bool kernel)
preloadedImage->id = image->id;
// modules_init() uses this information to get the preloaded images
// we now no longer need to write to the text area anymore
set_area_protection(image->text_region.id,
B_KERNEL_READ_AREA | B_KERNEL_EXECUTE_AREA);
return B_OK;
error1:
+2
View File
@@ -2167,6 +2167,8 @@ create_preloaded_image_areas(struct preloaded_image *image)
image->text_region.id = create_area(name, &address, B_EXACT_ADDRESS,
PAGE_ALIGN(image->text_region.size), B_ALREADY_WIRED,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
// this will later be remapped read-only/executable by the
// ELF initialization code
strcpy(name + length, "_data");
address = (void *)ROUNDOWN(image->data_region.start, B_PAGE_SIZE);