From fa77a37199208fa207202e62f409e1371c5f03f3 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sat, 23 May 2026 22:47:35 -0700 Subject: added a couple new instructions this turns out to be fairly involved. hex bootstrap can't come fast enough ;) Force-Push: yes Change-Id: Ide5d2207d745ad07c40d3c9f457cd6b491bfbcf0 --- elf.e | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'elf.e') diff --git a/elf.e b/elf.e index 68eb6f2..7801bf6 100644 --- a/elf.e +++ b/elf.e @@ -107,6 +107,32 @@ ~ program header's size. current-offset 4 roll - L!' elf-program-header-size ; + +~ This alternate version of the program header isn't used by evoke.e, but +~ may be useful for other programs, such as hex.e. Its only difference from +~ the base version is that it adds the write permission. +: elf-program-header-writable + ~ * denotes mandatory fields according to breadbox + current-offset L!' elf-program-header + current-offset 3unroll + + 1 pack32 ~ *"loadable" segment type + 0x07 pack32 ~ *read+write+execute permission + 0 pack64 ~ *offset in file + L@' origin pack64 ~ *virtual address + ~ required, but can be anything, subject to alignment + 0 pack64 ~ physical address (ignored) + + L@' total-size pack64 ~ *size in file + L@' total-size pack64 ~ *size in memory + + 0 pack64 ~ segment alignment + ~ for relocation, but this doesn't apply to us + + ~ As with the file header, we use the label system to keep track of the + ~ program header's size. + current-offset 4 roll - L!' elf-program-header-size ; + ~ ~~~~~~~~~~~~~~~~ ~ ~~ That's it! ~~ ~ ~~~~~~~~~~~~~~~~ -- cgit 1.4.1