summaryrefslogtreecommitdiff
path: root/sys/man
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-05-29 14:18:35 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2021-05-29 14:18:35 +0200
commitc2297ce5c180e98f2217a691a25d19a300956d9f (patch)
tree0ed1ffd50a8618f2d3b8071370efe88d1b70904e /sys/man
parentd168b89ab110a2d1fcaf72ad085a789092b82b00 (diff)
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.
Diffstat (limited to 'sys/man')
-rw-r--r--sys/man/6/a.out15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/man/6/a.out b/sys/man/6/a.out
index 50ceb892a..f3ffa6dbd 100644
--- a/sys/man/6/a.out
+++ b/sys/man/6/a.out
@@ -25,7 +25,7 @@ typedef struct Exec {
long pcsz; /* size of pc/line number table */
} Exec;
-#define HDR_MAGIC 0x00008000
+#define HDR_MAGIC 0x00008000 /* header expansion */
#define _MAGIC(f, b) ((f)|((((4*(b))+0)*(b))+7))
#define A_MAGIC _MAGIC(0, 8) /* 68020 */
@@ -62,7 +62,18 @@ The text segment consists of the header and the first
bytes of the binary file.
The
.B entry
-field gives the virtual address of the entry point of the program.
+field gives the virtual address of the entry point of the program
+unless
+.B HDR_MAGIC
+flag is present in the
+.B magic
+field.
+In that case, the header is expanded
+by 8 bytes containing the 64-bit virtual address of the
+program entry point and the 32-bit
+.B entry
+field is reserved for physical kernel entry point.
+.PP
The data segment starts at the first page-rounded virtual address
after the text segment.
It consists of the next