mirror of
https://github.com/drasko/codezero.git
synced 2026-01-21 07:13:15 +01:00
Elf file checking - Added the test that data and text are at least a page apart.
This commit is contained in:
@@ -97,7 +97,10 @@ int elf_mark_segments(struct elf_section_header *sect_header, int nsections,
|
||||
"bss segment in ELF file.\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
/* Data and text are less than page apart and unaligned */
|
||||
/* Data and text are on the same page and not on a page boundary */
|
||||
if (!((is_page_aligned(task->data_start) &&
|
||||
task->data_start == task->text_end) ||
|
||||
(page_align(task->data_start) > page_align(task->text_end))))
|
||||
if ((task->data_start - task->text_end) < PAGE_SIZE &&
|
||||
!is_page_aligned(task->text_end)) {
|
||||
printf("%s: Error: Distance between data and text"
|
||||
|
||||
Reference in New Issue
Block a user