Fixed a scoping bug in the elf_load_kspace() function (non-critical under
normal circumstances, though). Updated the comment why we have to create the read-only segment as read-write. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5055 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -667,6 +667,8 @@ error:
|
|||||||
image_id
|
image_id
|
||||||
elf_load_kspace(const char *path, const char *sym_prepend)
|
elf_load_kspace(const char *path, const char *sym_prepend)
|
||||||
{
|
{
|
||||||
|
bool ro_segment_handled = false;
|
||||||
|
bool rw_segment_handled = false;
|
||||||
struct Elf32_Ehdr *eheader;
|
struct Elf32_Ehdr *eheader;
|
||||||
struct Elf32_Phdr *pheaders;
|
struct Elf32_Phdr *pheaders;
|
||||||
struct elf_image_info *image;
|
struct elf_image_info *image;
|
||||||
@@ -749,8 +751,6 @@ elf_load_kspace(const char *path, const char *sym_prepend)
|
|||||||
|
|
||||||
for (i = 0; i < eheader->e_phnum; i++) {
|
for (i = 0; i < eheader->e_phnum; i++) {
|
||||||
char region_name[64];
|
char region_name[64];
|
||||||
bool ro_segment_handled = false;
|
|
||||||
bool rw_segment_handled = false;
|
|
||||||
int image_region;
|
int image_region;
|
||||||
int protection;
|
int protection;
|
||||||
|
|
||||||
@@ -787,8 +787,9 @@ elf_load_kspace(const char *path, const char *sym_prepend)
|
|||||||
ro_segment_handled = true;
|
ro_segment_handled = true;
|
||||||
image_region = 0;
|
image_region = 0;
|
||||||
protection = B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA;
|
protection = B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA;
|
||||||
// ToDo: why is this? Right now, the kernel crashes without
|
// We need to read in the contents of this area later,
|
||||||
// it, so go, investigate!
|
// so it has to be writeable at this point;
|
||||||
|
// ToDo: we should change the area protection later.
|
||||||
|
|
||||||
sprintf(region_name, "%s_ro", path);
|
sprintf(region_name, "%s_ro", path);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user