qemu-e2k/linux-user
Laurent Vivier 80f5ce758a linux-user: correct core dump format
This patch allows to really use the core dumped by qemu with guest
architecture tools.

- it adds a missing bswap_phdr() for the program headers
  of memory regions.

  "objdump -x" sample:

BEFORE:

0x1000000 off    0x00200000 vaddr 0x00000400 paddr 0x00000000 align 2**21
         filesz 0x00000000 memsz 0x00100000 flags ---
0x1000000 off    0x00200000 vaddr 0x00100400 paddr 0x00000000 align 2**21
         filesz 0x00000000 memsz 0x00080000 flags --- 6000000

AFTER:

    LOAD off    0x00002000 vaddr 0x00040000 paddr 0x00000000 align 2**13
         filesz 0x00000000 memsz 0x00001000 flags ---
    LOAD off    0x00002000 vaddr 0x00041000 paddr 0x00000000 align 2**13
         filesz 0x00000000 memsz 0x00000800 flags rw-

- it doesn't pad the note size to sizeof(int32_t).
  On m68k the NT_PRSTATUS note size is 154 and
  must not be rounded up to 156, because this value is checked by
  objdump and gdb.

  "gdb" symptoms:

      "warning: Couldn't find general-purpose registers in core file."

  "objdump -x" sample:

BEFORE:

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 note0         000001c4  00000000  00000000  000003b4  2**0
                  CONTENTS, READONLY
  1 .auxv         00000070  00000000  00000000  00000508  2**2
                  CONTENTS
  2 proc1         00100000  00000400  00000000  00200000  2**10
                  READONLY

AFTER:

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 note0         000001c4  00000000  00000000  000003b4  2**0
                  CONTENTS, READONLY
  1 .reg/19022    00000050  00000000  00000000  0000040e  2**2
                  CONTENTS
  2 .reg          00000050  00000000  00000000  0000040e  2**2
                  CONTENTS
  3 .auxv         00000070  00000000  00000000  00000508  2**2
                  CONTENTS
  4 load1         00000000  00040000  00000000  00002000  2**13
                  ALLOC, READONLY

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2011-02-17 11:46:34 +02:00
..
alpha
arm linux-user/arm: fix compilation failures using softfloat's struct types 2011-02-10 20:18:36 +01:00
cris
i386
m68k
microblaze
mips
mips64
mipsn32
ppc
sh4
sparc
sparc64
x86_64
cpu-uname.c
cpu-uname.h
elfload.c linux-user: correct core dump format 2011-02-17 11:46:34 +02:00
errno_defs.h
flat.h
flatload.c linux-user/FLAT: allow targets to override FLAT processing 2011-02-09 10:33:54 +02:00
ioctls.h linux-user: fix for loopmount ioctl 2011-02-09 10:33:54 +02:00
linux_loop.h
linuxload.c
m68k-sim.c
main.c
mmap.c
qemu-types.h
qemu.h
signal.c linux-user/arm: fix compilation failures using softfloat's struct types 2011-02-10 20:18:36 +01:00
socket.h
strace.c linux-user: in linux-user/strace.c, tswap() is useless 2011-02-17 11:46:34 +02:00
strace.list linux-user: add rmdir() strace 2011-02-17 11:46:34 +02:00
syscall_defs.h linux-user: Support the epoll syscalls 2011-02-17 11:46:34 +02:00
syscall_types.h
syscall.c linux-user: Support the epoll syscalls 2011-02-17 11:46:34 +02:00
target_flat.h linux-user/FLAT: allow targets to override FLAT processing 2011-02-09 10:33:54 +02:00
uaccess.c
vm86.c