X-Git-Url: http://git.maemo.org/git/?p=qemu;a=blobdiff_plain;f=elf_ops.h;fp=elf_ops.h;h=72cd83eb744f29fdfebb83f543b5347b82ad5d19;hp=485442a935404f8d6eaf6b904d91b8d276ba4614;hb=759b334a9739814df2883aa4c41b1c0f5670e90a;hpb=7e2198fc87e878b8ce5df965477e21713ebf7834 diff --git a/elf_ops.h b/elf_ops.h index 485442a..72cd83e 100644 --- a/elf_ops.h +++ b/elf_ops.h @@ -185,7 +185,7 @@ static int glue(load_elf, SZ)(int fd, int64_t address_offset, struct elf_phdr *phdr = NULL, *ph; int size, i, total_size; elf_word mem_size; - uint64_t addr, low = 0, high = 0; + uint64_t addr, low = (uint64_t)-1, high = 0; uint8_t *data = NULL; if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) @@ -249,9 +249,9 @@ static int glue(load_elf, SZ)(int fd, int64_t address_offset, cpu_physical_memory_write_rom(addr, data, mem_size); total_size += mem_size; - if (!low || addr < low) + if (addr < low) low = addr; - if (!high || (addr + mem_size) > high) + if ((addr + mem_size) > high) high = addr + mem_size; qemu_free(data);