diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-05-23 22:47:35 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-05-23 22:47:35 -0700 |
| commit | fa77a37199208fa207202e62f409e1371c5f03f3 (patch) | |
| tree | fc58aee7e0fbd3dc012277724622a75a3f4a9ff0 /elf.e | |
| parent | d65031570a3f678b03b29ea8a2293e0b8fad7907 (diff) | |
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
Diffstat (limited to 'elf.e')
| -rw-r--r-- | elf.e | 26 |
1 files changed, 26 insertions, 0 deletions
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! ~~ ~ ~~~~~~~~~~~~~~~~ |