From 5dce07e1cb67aab265b16e39b0b9d812199a4d22 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 9 Mar 2015 11:12:52 +0100 Subject: elf-loader: Provide the possibility to relocate s390 ELF files 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 Message-Id: <1425895973-15239-2-git-send-email-thuth@linux.vnet.ibm.com> Acked-by: Alexander Graf Signed-off-by: Christian Borntraeger --- hw/core/loader.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/core/loader.c') diff --git a/hw/core/loader.c b/hw/core/loader.c index e45dc0b..76d8aca 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -297,6 +297,7 @@ static void *load_at(int fd, int offset, int size) #undef elf_phdr #undef elf_shdr #undef elf_sym +#undef elf_rela #undef elf_note #undef elf_word #undef elf_sword @@ -307,6 +308,7 @@ static void *load_at(int fd, int offset, int size) #define elf_note elf64_note #define elf_shdr elf64_shdr #define elf_sym elf64_sym +#define elf_rela elf64_rela #define elf_word uint64_t #define elf_sword int64_t #define bswapSZs bswap64s -- cgit v1.1