shithub: riscv

Download patch

ref: c2297ce5c180e98f2217a691a25d19a300956d9f
parent: d168b89ab110a2d1fcaf72ad085a789092b82b00
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 29 10:18:35 EDT 2021

kernel: use 64-bit virtual entry point for expanded header, document behaviour in a.out(6)

For 64-bit architectures, the a.out header has the HDR_MAGIC flag set
in the magic and is expanded by 8 bytes containing the 64-bit virtual
address of the programs entry point. While Exec.entry contains physical
address for kernel images.

Our sysexec() would always use Exec.entry, even for 64-bit a.out binaries,
which worked because PADDR(entry) == entry for userspace pointers.

This change fixes it, having the kernel use the 64-bit entry point
and document the behaviour in the manpage.