hw/mips: Simplify loading 64-bit ELF kernels
Since 8279006411
("Cast ELF datatypes properly to host 64bit types")
we don't need to sign-extend the entry_point address. Remove this
unnecessary code.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200927163943.614604-2-f4bug@amsat.org>
This commit is contained in:
parent
8df525a558
commit
9d585eaa87
@ -77,11 +77,7 @@ static int64_t load_kernel(void)
|
|||||||
(uint64_t *)&entry, NULL,
|
(uint64_t *)&entry, NULL,
|
||||||
(uint64_t *)&kernel_high, NULL, big_endian,
|
(uint64_t *)&kernel_high, NULL, big_endian,
|
||||||
EM_MIPS, 1, 0);
|
EM_MIPS, 1, 0);
|
||||||
if (kernel_size >= 0) {
|
if (kernel_size < 0) {
|
||||||
if ((entry & ~0x7fffffffULL) == 0x80000000) {
|
|
||||||
entry = (int32_t)entry;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error_report("could not load kernel '%s': %s",
|
error_report("could not load kernel '%s': %s",
|
||||||
loaderparams.kernel_filename,
|
loaderparams.kernel_filename,
|
||||||
load_elf_strerror(kernel_size));
|
load_elf_strerror(kernel_size));
|
||||||
|
@ -102,11 +102,7 @@ static int64_t load_kernel(void)
|
|||||||
(uint64_t *)&entry, NULL,
|
(uint64_t *)&entry, NULL,
|
||||||
(uint64_t *)&kernel_high, NULL, big_endian,
|
(uint64_t *)&kernel_high, NULL, big_endian,
|
||||||
EM_MIPS, 1, 0);
|
EM_MIPS, 1, 0);
|
||||||
if (kernel_size >= 0) {
|
if (kernel_size < 0) {
|
||||||
if ((entry & ~0x7fffffffULL) == 0x80000000) {
|
|
||||||
entry = (int32_t)entry;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error_report("could not load kernel '%s': %s",
|
error_report("could not load kernel '%s': %s",
|
||||||
loaderparams.kernel_filename,
|
loaderparams.kernel_filename,
|
||||||
load_elf_strerror(kernel_size));
|
load_elf_strerror(kernel_size));
|
||||||
|
Loading…
Reference in New Issue
Block a user