Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
Remove brk special handling
Browse files Browse the repository at this point in the history
Reverts arsv/riscv-qemu@6268f398; this should fix the observed segfaults
on statically linked binaries with the new linker script.
  • Loading branch information
sorear authored and aswaterman committed Jan 12, 2017
1 parent 21e3a7c commit 168b877
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions linux-user/elfload.c
Expand Up @@ -1980,6 +1980,9 @@ static void load_elf_image(const char *image_name, int image_fd,
if (vaddr_ef > info->end_data) {
info->end_data = vaddr_ef;
}
if (vaddr_em > info->brk) {
info->brk = vaddr_em;
}
}
} else if (eppnt->p_type == PT_INTERP && pinterp_name) {
char *interp_name;
Expand Down Expand Up @@ -2014,12 +2017,9 @@ static void load_elf_image(const char *image_name, int image_fd,
if (info->end_data == 0) {
info->start_data = info->end_code;
info->end_data = info->end_code;
info->brk = info->end_code;
}

/* Heap should be located past both .text and .data */
info->brk = (info->end_code > info->end_data ?
info->end_code : info->end_data);

if (qemu_log_enabled()) {
load_symbols(ehdr, image_fd, load_bias);
}
Expand Down

0 comments on commit 168b877

Please sign in to comment.