linux-user: Handle filesz < memsz for any PT_LOAD segment.
commitcf129f3a8eea76a34bc748762c31bbc27eabe540
authorRichard Henderson <rth@twiddle.net>
Tue, 27 Jul 2010 17:25:27 +0000 (27 10:25 -0700)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Thu, 29 Jul 2010 06:32:27 +0000 (29 08:32 +0200)
tree25f67db1b11263eaa4088c63953cf1319e8a5491
parent36500de674a3caa37cab5b4665458a318d0c2173
linux-user: Handle filesz < memsz for any PT_LOAD segment.

I caught padzero not properly initializing the .bss segment
on a statically linked Alpha program.  Rather than a minimal
patch, replace the gross code with a single mmap+memset.

Share more code between load_elf_interp and load_elf_binary.

Legally, an ELF program need not have just a single .bss;
and PT_LOAD segment can have memsz > filesz.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
linux-user/elfload.c