diff options
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! ~~ ~ ~~~~~~~~~~~~~~~~ |