summaryrefslogtreecommitdiffstats
path: root/include/hw/elf_ops.h
Commit message (Collapse)AuthorAgeFilesLines
* elf: Update EM_MOXIE definitionPeter Crosthwaite2015-09-251-0/+8
| | | | | | | | | | EM_MOXIE now has a proper assigned elf code. Use it. Register the old interim value as EM_MOXIE_OLD and accept either in elf loading. Cc: Anthony Green <green@moxielogic.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* elf_ops: Fix coding style for EM alias case statementPeter Crosthwaite2015-09-251-6/+9
| | | | | | | | | Fix the coding style for these cases as per CODING_STYLE. Reverse the Yoda conditions and add missing if braces. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* elf-loader: Add missing error handling for call of lseekStefan Weil2015-03-191-1/+3
| | | | | | | | This fixes a warning from Coverity. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* elf-loader: Provide the possibility to relocate s390 ELF filesThomas Huth2015-03-101-0/+78
| | | | | | | | | | | | On s390, we would like to load our "BIOS" s390-ccw.img to the end of the RAM. Therefor we need the possibility to relocate the ELF file so that it can also run from different addresses. This patch adds the necessary code to the QEMU ELF loader function. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Message-Id: <1425895973-15239-2-git-send-email-thuth@linux.vnet.ibm.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
* loader: g_realloc(p, 0) frees and returns NULL, simplifyMarkus Armbruster2014-09-291-10/+5
| | | | | | | | | | | | | Once upon a time, it was decided that qemu_realloc(ptr, 0) should abort. Switching to glib retired that bright idea. A bit of code that was added to cope with it (commit 3e372cf) is still around. Bury it. See also commit 6528499. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* elf-loader: add more return codesAlexey Kardashevskiy2014-03-051-5/+14
| | | | | | | | | | | | | | | | | | The existing load_elf() just returns -1 if it fails to load ELF. However it could be smarter than this and tell more about the failure such as wrong endianness or incompatible platform. This adds additional return codes for wrong architecture, wrong endianness and if the image is not ELF at all. This adds a load_elf_strerror() helper to convert return codes into string messages. This fixes handling of what load_elf() returns for s390x, other callers just check the return value for <0 and this remains unchanged. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw: move headers to include/Paolo Bonzini2013-04-081-0/+309
Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud