Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ELF segment end computation #422

Merged
merged 2 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/libia2/ia2.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ int protect_pages(struct dl_phdr_info *info, size_t size, void *data) {
int access_flags = segment_flags_to_access_flags(phdr.p_flags);

Elf64_Addr start = (info->dlpi_addr + phdr.p_vaddr) & ~0xFFFUL;
Elf64_Addr seg_end = (start + phdr.p_memsz + 0xFFFUL) & ~0xFFFUL;
Elf64_Addr seg_end = (info->dlpi_addr + phdr.p_vaddr + phdr.p_memsz + 0xFFFUL) & ~0xFFFUL;
while (start < seg_end) {
Elf64_Addr cur_end = seg_end;

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (NOT LIBIA2_AARCH64)
add_subdirectory(two_shared_ranges)
# TODO(#413): Fix these tests
add_subdirectory(heap_two_keys)
# add_subdirectory(three_keys_minimal)
add_subdirectory(three_keys_minimal)

# strange bug with indirect calls
add_subdirectory(read_config)
Expand Down