Re: [Qemu-devel] [PATCH 2/2] loader: Ignore zero-sized ELF segments

2017-08-08 Thread Hua Yanghao
Tested-by: Hua Yanghao On Mon, Aug 7, 2017 at 4:39 PM, Peter Maydell wrote: > Some ELF files have program headers that specify segments that > are of zero size. Ignore them, rather than trying to create > zero-length ROM blobs for them, because the zero-length blob > can falsely

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-25 Thread Hua Yanghao
On Mon, Jul 24, 2017 at 11:21 PM, Peter Maydell wrote: > On 24 July 2017 at 21:03, Hua Yanghao wrote: >> Sounds good PPM! currently I am working around this by >> objcopy a pure binary and it looks like qemu-system-arm is >> loading a binary at loader address + 0x1

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-24 Thread Hua Yanghao
On Mon, Jul 24, 2017 at 6:46 PM, Peter Maydell wrote: > On 23 July 2017 at 21:44, Peter Maydell wrote: >> Does anybody know (a) what the ELF spec mandates >> for overlapping segments and (b) what the history >> and rationale for QEMU's overlapping-roms check is? > > Having asked around a bit, it

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-24 Thread Hua Yanghao
> In the bit of the spec you quote it says how p_memsz > p_filesz > should be handled: "the 'extra' bytes are defined to hold the > value 0". The segment itself is still p_memsz in size and the > header defines that it has zeroes at the end of it. QEMU's loader > needs to arrange that those zeroes

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-24 Thread Hua Yanghao
On Mon, Jul 24, 2017 at 2:09 PM, Hua Yanghao wrote: >> Yep, this is complaining because you have two LOAD >> segments which overlap: >> LOAD off0x00e0 vaddr 0x6000 paddr 0x6000 align 2**5 >> filesz 0x0007773c memsz 0x00077c00 flags r

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-24 Thread Hua Yanghao
> Yep, this is complaining because you have two LOAD > segments which overlap: > LOAD off0x00e0 vaddr 0x6000 paddr 0x6000 align 2**5 > filesz 0x0007773c memsz 0x00077c00 flags rwx > > which goes from 0x6000 up to 0x600077bff, and > > LOAD off0x00077820 va

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-24 Thread Hua Yanghao
you must have a locally modified qemu-system-arm to work with this build! Please contact Hua Yanghao for more details! echo "==> Ctrl-A X to exit"; export QEMU_AUDIO_DRV="none"; qemu-system-arm -M vexpress-a9 -m 512M -smp cpus=1 -nographic -kernel output/qemu_arm_vexpress/qemu_arm

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-23 Thread Hua Yanghao
> Suppose we have these two segments: > SEGMENT 1: start 0x1000, end 0x2fff, data all 0xff > SEGMENT 2: start 0x2000, end 0x3fff, data all 0x00 > > Clearly for the memory 0x1000..0x1fff we want the 0xff > data, and for 0x3000..0x3fff we want 0x00. > But for the memory 0x2000..0x2fff which is in >

Re: [Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-23 Thread Hua Yanghao
> (I'm not sure why you end up with overlapping > program segments here since the bss segment ought > to be marked NOLOAD and ignored by QEMU. But I've > definitely seen overlapping segments myself where > the segments overlapping both are marked as LOAD.) Looks like qemu is not ignoring NOLOAD sec

[Qemu-devel] [PATCH] hw/core/loader: do not check for regions overlap

2017-07-23 Thread Hua Yanghao
>From 84f25a8e4269f44255a8037837fdaa6e5404b76e Mon Sep 17 00:00:00 2001 From: Hua Yanghao Date: Sun, 23 Jul 2017 21:48:21 +0200 Subject: [PATCH] hw/core/loader: do not check for regions overlap There is a use case where regions are overlapped on purpose. It should be up to the linker to ch